diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-08-27 19:06:42 +0200 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-04 06:40:14 +0000 |
commit | 314a591461c58addd2805e0b4dc2cdb4308d5d31 (patch) | |
tree | db353751ef969c00d9649c7c424c14d06ca83472 /src/widgets/widgets/qmdisubwindow.cpp | |
parent | b649717784368f04e61f5bc240c052c5c4744a2c (diff) |
Convert features.menubar to QT_[REQUIRE_]CONFIG
Change-Id: Idbd4978852fa280dd18a5684469d499da3892126
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmdisubwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmdisubwindow.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index 663572802c..0abc4967e1 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -165,6 +165,7 @@ #endif #include <QMdiArea> #include <QScopedValueRollback> +#include <QMenu> QT_BEGIN_NAMESPACE @@ -703,7 +704,7 @@ ControlContainer::ControlContainer(QMdiSubWindow *mdiChild) : QObject(mdiChild), previousLeft(0), previousRight(0), -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) m_menuBar(0), #endif mdiChild(mdiChild) @@ -725,7 +726,7 @@ ControlContainer::ControlContainer(QMdiSubWindow *mdiChild) ControlContainer::~ControlContainer() { -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) removeButtonsFromMenuBar(); #endif delete m_menuLabel; @@ -734,7 +735,7 @@ ControlContainer::~ControlContainer() m_controllerWidget = 0; } -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) /* \internal */ @@ -846,7 +847,7 @@ void ControlContainer::removeButtonsFromMenuBar(QMenuBar *menuBar) mdiChild->window()->setWindowTitle(mdiChild->d_func()->originalWindowTitle()); } -#endif // QT_NO_MENUBAR +#endif // QT_CONFIG(menubar) void ControlContainer::updateWindowIcon(const QIcon &windowIcon) { @@ -1268,7 +1269,7 @@ void QMdiSubWindowPrivate::setNormalMode() isMaximizeMode = false; ensureWindowState(Qt::WindowNoState); -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) removeButtonsFromMenuBar(); #endif @@ -1375,7 +1376,7 @@ void QMdiSubWindowPrivate::setMaximizeMode() updateGeometryConstraints(); if (wasVisible) { -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) if (QMenuBar *mBar = menuBar()) showButtonsInMenuBar(mBar); else @@ -1438,7 +1439,7 @@ void QMdiSubWindowPrivate::setActive(bool activate, bool changeFocus) Qt::WindowStates oldWindowState = q->windowState(); ensureWindowState(Qt::WindowActive); emit q->aboutToActivate(); -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) if (QMenuBar *mBar = menuBar()) showButtonsInMenuBar(mBar); #endif @@ -1783,7 +1784,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const #else if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q)) return true; -#if defined(QT_NO_MENUBAR) || defined(QT_NO_MAINWINDOW) +#if !QT_CONFIG(menubar) || defined(QT_NO_MAINWINDOW) Q_UNUSED(isChildOfQMdiSubWindow); return true; #else @@ -1797,7 +1798,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const #endif } -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) /*! \internal @@ -1868,7 +1869,7 @@ void QMdiSubWindowPrivate::removeButtonsFromMenuBar() originalTitle.clear(); } -#endif // QT_NO_MENUBAR +#endif // QT_CONFIG(menubar) void QMdiSubWindowPrivate::updateWindowTitle(bool isRequestFromChild) { @@ -2295,7 +2296,7 @@ QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags) QMdiSubWindow::~QMdiSubWindow() { Q_D(QMdiSubWindow); -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) d->removeButtonsFromMenuBar(); #endif d->setActive(false); @@ -2628,7 +2629,7 @@ void QMdiSubWindow::showShaded() d->ensureWindowState(Qt::WindowMinimized); } -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) d->removeButtonsFromMenuBar(); #endif @@ -2768,7 +2769,7 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event) if (object == d->baseWidget) { d->updateWindowTitle(true); d->lastChildWindowTitle = d->baseWidget->windowTitle(); -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) } else if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()) { d->originalTitle.clear(); @@ -2831,7 +2832,7 @@ bool QMdiSubWindow::event(QEvent *event) break; case QEvent::ParentChange: { bool wasResized = testAttribute(Qt::WA_Resized); -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) d->removeButtonsFromMenuBar(); #endif d->currentOperation = QMdiSubWindowPrivate::None; @@ -2888,12 +2889,12 @@ bool QMdiSubWindow::event(QEvent *event) case QEvent::ModifiedChange: if (!windowTitle().contains(QLatin1String("[*]"))) break; -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) if (maximizedButtonsWidget() && d->controlContainer->menuBar() && d->controlContainer->menuBar() ->cornerWidget(Qt::TopRightCorner) == maximizedButtonsWidget()) { window()->setWindowModified(isWindowModified()); } -#endif // QT_NO_MENUBAR +#endif // QT_CONFIG(menubar) d->updateInternalWindowTitle(); break; case QEvent::LayoutDirectionChange: @@ -2956,7 +2957,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent) d->updateDirtyRegions(); // Show buttons in the menu bar if they're already not there. // We want to do this when QMdiSubWindow becomes visible after being hidden. -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) if (d->controlContainer) { if (QMenuBar *menuBar = d->menuBar()) { if (menuBar->cornerWidget(Qt::TopRightCorner) != maximizedButtonsWidget()) @@ -2972,7 +2973,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent) */ void QMdiSubWindow::hideEvent(QHideEvent * /*hideEvent*/) { -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) d_func()->removeButtonsFromMenuBar(); #endif } @@ -3046,7 +3047,7 @@ void QMdiSubWindow::closeEvent(QCloseEvent *closeEvent) closeEvent->ignore(); return; } -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) d->removeButtonsFromMenuBar(); #endif d->setActive(false); |