summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenubar.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/qmenubar.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/qmenubar.h')
-rw-r--r--src/widgets/widgets/qmenubar.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/widgets/qmenubar.h b/src/widgets/widgets/qmenubar.h
index b2a2a227e9..990027f16a 100644
--- a/src/widgets/widgets/qmenubar.h
+++ b/src/widgets/widgets/qmenubar.h
@@ -43,6 +43,10 @@
#define QMENUBAR_H
#include <QtWidgets/qmenu.h>
+#ifdef Q_OS_MAC
+#include "QtWidgets/qmacdefines_mac.h"
+#endif
+
QT_BEGIN_HEADER
@@ -106,7 +110,7 @@ public:
void setCornerWidget(QWidget *w, Qt::Corner corner = Qt::TopRightCorner);
QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
OSMenuRef macMenu();
static bool macUpdateMenuBar();
#endif
@@ -351,7 +355,7 @@ private:
friend class QMenuPrivate;
friend class QWindowsStyle;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
friend class QApplicationPrivate;
friend class QWidgetPrivate;
friend bool qt_mac_activate_action(MenuRef, uint, QAction::ActionEvent, bool);