diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-04-24 14:00:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-25 17:56:26 +0200 |
commit | 220b2b92b62fb6c45a31e2a8f80e26f115166137 (patch) | |
tree | 919c242e8addc455a2bde20df408e15582406bf5 /src/plugins/platforms/cocoa/qcocoamenuitem.h | |
parent | 370e89f06465a4d61c7b72291115cd7b5a0d576a (diff) |
Cocoa: Improve text heuristic menu item syncing logic
Don't try anything after the original syncing, particularly after
changing the menu item's text. Also, don't try anything if the menu
item cannot be linked up to a menubar (see QTBUG-30756). This latter
point requires extra syncing after adding a menu in the menubar.
Finally, to be able to find the menubar, we need to clean the code for
moc's eyes.
Task-number: QTBUG-30756
Task-number: QTBUG-30812
Change-Id: I88fad663f1c35d03a0cb167d1723d16f590918c0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenuitem.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoamenuitem.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.h b/src/plugins/platforms/cocoa/qcocoamenuitem.h index 0e6d17343d..1e69ed5a4b 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.h +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.h @@ -48,8 +48,16 @@ //#define QT_COCOA_ENABLE_MENU_DEBUG -@class NSMenuItem; -@class NSMenu; +#ifdef __OBJC__ +#define QT_FORWARD_DECLARE_OBJC_CLASS(__KLASS__) @class __KLASS__ +#else +#define QT_FORWARD_DECLARE_OBJC_CLASS(__KLASS__) typedef struct objc_object __KLASS__ +#endif + +QT_FORWARD_DECLARE_OBJC_CLASS(NSMenuItem); +QT_FORWARD_DECLARE_OBJC_CLASS(NSMenu); +QT_FORWARD_DECLARE_OBJC_CLASS(NSObject); + QT_BEGIN_NAMESPACE @@ -96,6 +104,7 @@ private: NSMenuItem *m_native; QString m_text; + bool m_textSynced; QIcon m_icon; QCocoaMenu *m_menu; bool m_isVisible; |