本文整理汇总了C++中QMdiSubWindow::isMaximized方法的典型用法代码示例。如果您正苦于以下问题:C++ QMdiSubWindow::isMaximized方法的具体用法?C++ QMdiSubWindow::isMaximized怎么用?C++ QMdiSubWindow::isMaximized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMdiSubWindow
的用法示例。
在下文中一共展示了QMdiSubWindow::isMaximized方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventFilter
bool MWMDIManagerImpl::eventFilter(QObject *obj, QEvent *event) {
QEvent::Type t = event->type();
if ( t == QEvent::Close) {
QMdiSubWindow* qw = qobject_cast<QMdiSubWindow*>(obj);
MDIItem* item = getMDIItem(qw);
uiLog.trace(QString("Processing close window request for '%1'").arg(getWindowName(item)));
//check if user really wants to close the window, ignore event if not
if (!onCloseEvent(item->w)) {
uiLog.trace(QString("Ignoring close window request for '%1'").arg(getWindowName(item)));
event->ignore();
return true;
}
// here we sure that window will be closed
emit si_windowClosing(item->w);
if (item == mdiContentOwner) { // if 'current' window is closed -> clear MDI
clearMDIContent(true);
}
items.removeAll(item);
delete item;
updateState();
} else if (t == QEvent::WindowStateChange) {
QMdiSubWindow* qw = qobject_cast<QMdiSubWindow*>(obj);
defaultIsMaximized = qw->isMaximized();
}
return QObject::eventFilter(obj, event);
}
示例2: setWidthOfMdiWindow
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::setWidthOfMdiWindow(QWidget* mdiWindowWidget, int newWidth)
{
QMdiSubWindow* mdiWindow = findMdiSubWindow(mdiWindowWidget);
if (mdiWindow)
{
QSize subWindowSize = mdiWindow->size();
subWindowSize.setWidth(std::max(newWidth, 100));
mdiWindow->resize(subWindowSize);
if (mdiWindow->isMaximized())
{
// Set window temporarily to normal state and back to maximized
// to redo layout so the whole window canvas is filled
// Tried to activate layout, did not work as expected
// Tested code:
// m_layout->activate();
// mdiWindow->layout()->activate();
mdiWindow->showNormal();
mdiWindow->showMaximized();
}
}
}