diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-09-02 12:25:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-21 05:09:33 +0200 |
commit | dd7bfffa77c231296ca977d6c7d487962f7ebae9 (patch) | |
tree | 266d9416c273e271deae09169dbf29476d6c3d7e /src/widgets/widgets/qmenu.h | |
parent | f9365b0acc87808599ebf2e121abd67eac946743 (diff) |
Add QMenu -> NSMenu conversion functions.
Add QMenu::toNSMenu() and QMenuBar()::toNSMenu().
Add QMenu::setAsDockMenu and qt_mac_set_doc_menu(QMenu *menu)
These are all API wrappers around implementation
in the Cocoa platform plugin.
Change-Id: I927ed4fb5dc42cc577a41a80b531a4a2f7b8812c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets/widgets/qmenu.h')
-rw-r--r-- | src/widgets/widgets/qmenu.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index 518771d846..7a128e871c 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -50,6 +50,9 @@ #ifdef Q_OS_WINCE #include <windef.h> // for HMENU #endif +#ifdef Q_OS_OSX +Q_FORWARD_DECLARE_OBJC_CLASS(NSMenu); +#endif QT_BEGIN_NAMESPACE @@ -141,6 +144,10 @@ public: #ifdef Q_OS_WINCE HMENU wceMenu(); #endif +#ifdef Q_OS_OSX + NSMenu* toNSMenu(); + void setAsDockMenu(); +#endif bool separatorsCollapsible() const; void setSeparatorsCollapsible(bool collapse); @@ -204,6 +211,11 @@ private: friend void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action); }; +#ifdef Q_OS_OSX +// ### Qt 4 compatibility; remove in Qt 6 +inline QT_DEPRECATED void qt_mac_set_dock_menu(QMenu *menu) { menu->setAsDockMenu(); } +#endif + #endif // QT_NO_MENU QT_END_NAMESPACE |