summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qmainwindow.cpp')
-rw-r--r--src/widgets/widgets/qmainwindow.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index e1841bbc55..d97fedadab 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -42,15 +42,16 @@
#include "qmainwindow.h"
#include "qmainwindowlayout_p.h"
-#ifndef QT_NO_MAINWINDOW
-
#if QT_CONFIG(dockwidget)
#include "qdockwidget.h"
#endif
#include "qtoolbar.h"
#include <qapplication.h>
+#include <qmenu.h>
+#if QT_CONFIG(menubar)
#include <qmenubar.h>
+#endif
#if QT_CONFIG(statusbar)
#include <qstatusbar.h>
#endif
@@ -491,7 +492,7 @@ void QMainWindow::setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle)
emit toolButtonStyleChanged(d->toolButtonStyle);
}
-#ifndef QT_NO_MENUBAR
+#if QT_CONFIG(menubar)
/*!
Returns the menu bar for the main window. This function creates
and returns an empty menu bar if the menu bar does not exist.
@@ -578,7 +579,7 @@ void QMainWindow::setMenuWidget(QWidget *menuBar)
}
d->layout->setMenuBar(menuBar);
}
-#endif // QT_NO_MENUBAR
+#endif // QT_CONFIG(menubar)
#if QT_CONFIG(statusbar)
/*!
@@ -1412,7 +1413,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event)
// children and for the menu bar as well
QWidget *child = childAt(event->pos());
while (child && child != this) {
-#ifndef QT_NO_MENUBAR
+#if QT_CONFIG(menubar)
if (QMenuBar *mb = qobject_cast<QMenuBar *>(child)) {
if (mb->parentWidget() != this)
return;
@@ -1443,7 +1444,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event)
if (child == this)
return;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QMenu *popup = createPopupMenu();
if (popup) {
if (!popup->isEmpty()) {
@@ -1458,7 +1459,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event)
}
#endif // QT_NO_CONTEXTMENU
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
Returns a popup menu containing checkable entries for the toolbars and
dock widgets present in the main window. If there are no toolbars and
@@ -1519,10 +1520,8 @@ QMenu *QMainWindow::createPopupMenu()
Q_UNUSED(d);
return menu;
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
QT_END_NAMESPACE
#include "moc_qmainwindow.cpp"
-
-#endif // QT_NO_MAINWINDOW