summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu.h
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-07-05 15:02:39 +0200
committerMorten Sorvig <morten.sorvig@nokia.com>2011-07-06 09:59:36 +0200
commit4ed17a650847d4ad129478608e9697c909126263 (patch)
treebddc9d0107bf05690b8b58a0fe73a337e59eb409 /src/widgets/widgets/qmenu.h
parent14757fedb2e4a92fb37a90a88485107909f4f5e1 (diff)
Start porting the Mac menu system to QPA.
Global changes: qglobal.h: remove code that sets Q_WS_MAC and Q_MAC_USE_COCOA - this is dead code now. Add qt_widget_helpers_mac_p.h/mm which will contain helper functions needed for widgets on Qt 5. Menu-related changes: Set AA_DontUseNativeMenuBar before creating the platform plugin. Change Q_WS_MAC to Q_OS_MAC in the menu code. Remove Q_MAC_USE_COCOA defines and Carbon code paths. Move some qt_mac helper functions only used by the menu system to qmenu_mac.mm. #ifdef out some code paths that require further porting. Native menus are now disabled by default but can be enabled by the QPA plugins that want them by clearing AA_DontUseNativeMenuBar. Since we at compile time don't know which plugin will be loaded the Mac menu code is always included when building on OS X. (The above is currently only relevant for the Cocoa plugin.)
Diffstat (limited to 'src/widgets/widgets/qmenu.h')
-rw-r--r--src/widgets/widgets/qmenu.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index f8bedb3da4..84a1f1ef14 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -46,6 +46,10 @@
#include <QtCore/qstring.h>
#include <QtWidgets/qicon.h>
#include <QtWidgets/qaction.h>
+#ifdef Q_OS_MAC
+#include "QtWidgets/qmacdefines_mac.h"
+#endif
+
#ifdef QT3_SUPPORT
#include <QtGui/qpixmap.h>
@@ -141,7 +145,7 @@ public:
void setIcon(const QIcon &icon);
void setNoReplayFor(QWidget *widget);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
OSMenuRef macMenu(OSMenuRef merge=0);
#endif
@@ -415,7 +419,7 @@ private:
friend class QAction;
friend class QToolButtonPrivate;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
friend void qt_mac_trayicon_activate_action(QMenu *, QAction *action);
friend bool qt_mac_watchingAboutToShow(QMenu *);
friend OSStatus qt_mac_menu_event(EventHandlerCallRef, EventRef, void *);