diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-03 18:45:41 +0200 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-09-19 10:57:12 +0000 |
commit | 6d699d08200b1fe3a616dfbc275d46c98b77fcbd (patch) | |
tree | 6af5893454cca281d74cfba01109aa0c11135f04 /src/widgets/kernel | |
parent | 9833e682174c968efb62e6cd473787e3b0b8fb05 (diff) |
Convert features.menu to QT_[REQUIRE_]CONFIG
Change-Id: I031356411294b259ebd2b22c53159c93fd92af6e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qaction.cpp | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qaction.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qaction_p.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 4 |
5 files changed, 13 insertions, 5 deletions
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 002ca68720..f1788bb3f4 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -47,7 +47,9 @@ #include "qlist.h" #include <private/qshortcutmap_p.h> #include <private/qapplication_p.h> +#if QT_CONFIG(menu) #include <private/qmenu_p.h> +#endif #include <private/qdebug_p.h> #define QAPP_CHECK(functionName) \ @@ -643,7 +645,7 @@ QIcon QAction::icon() const return d->icon; } -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) /*! Returns the menu contained by this action. Actions that contain menus can be used to create menu items with submenus, or inserted @@ -670,7 +672,7 @@ void QAction::setMenu(QMenu *menu) menu->d_func()->setOverrideMenuAction(this); d->sendDataChanged(); } -#endif // QT_NO_MENU +#endif // QT_CONFIG(menu) /*! If \a b is true then this action will be considered a separator. diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h index 7dc4419d8e..41e29e6ab9 100644 --- a/src/widgets/kernel/qaction.h +++ b/src/widgets/kernel/qaction.h @@ -120,7 +120,7 @@ public: void setPriority(Priority priority); Priority priority() const; -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) QMenu *menu() const; void setMenu(QMenu *menu); #endif diff --git a/src/widgets/kernel/qaction_p.h b/src/widgets/kernel/qaction_p.h index 45394e0b52..992323f308 100644 --- a/src/widgets/kernel/qaction_p.h +++ b/src/widgets/kernel/qaction_p.h @@ -53,7 +53,9 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "QtWidgets/qaction.h" +#if QT_CONFIG(menu) #include "QtWidgets/qmenu.h" +#endif #if QT_CONFIG(graphicsview) #include "private/qgraphicswidget_p.h" #endif diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index 18376bb183..0585a59e89 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -45,7 +45,9 @@ #if QT_CONFIG(whatsthis) #include <qwhatsthis.h> #endif +#if QT_CONFIG(menu) #include <qmenu.h> +#endif #if QT_CONFIG(menubar) #include <qmenubar.h> #endif @@ -276,7 +278,7 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge #endif for (int i = 0; i < widgets.size(); ++i) { QWidget *w = widgets.at(i); -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) if (QMenu *menu = qobject_cast<QMenu *>(w)) { #ifdef Q_OS_DARWIN // On Mac, menu item shortcuts are processed before reaching any window. diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 415045a9f7..53b240d4d2 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -45,7 +45,9 @@ #include "qdesktopwidget_p.h" #include "qevent.h" #include "qlayout.h" +#if QT_CONFIG(menu) #include "qmenu.h" +#endif #include "qmetaobject.h" #include "qpixmap.h" #include "qpointer.h" @@ -8996,7 +8998,7 @@ bool QWidget::event(QEvent *event) case Qt::CustomContextMenu: emit customContextMenuRequested(static_cast<QContextMenuEvent *>(event)->pos()); break; -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) case Qt::ActionsContextMenu: if (d->actions.count()) { QMenu::exec(d->actions, static_cast<QContextMenuEvent *>(event)->globalPos(), |