summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenu.h
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2018-02-27 10:43:48 -0800
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2018-03-07 19:14:07 +0000
commite16c6dfb7286264ccdfd37d8e74c97f13ece7835 (patch)
treecbc206c63e84cf2f51240553cd101a28871e420c /src/plugins/platforms/cocoa/qcocoamenu.h
parent4dee5446bee9c7417bf6f5dc44294a0b7238a9ba (diff)
QCocoaMenuItem: Make QCocoaNSMenu the item target
Since we made the NSMenu delegate a singleton we could not rely on it to have enough information to implement worksWhenModal. At the same time as the delegate change, we derived NSMenu into QCocoaNSMenu. This allows us to extend the menu functionality and, in this case, serve as target for the Cocoa menu items. We also refactor setting the item's target/action. Manually tested against menurama and bigmenucreator tests, the test-case for QTBUG-17291, and the richtext/textedit example. Change-Id: I222241f71db82611711b23d4a8c6122a741370ae Task-number: QTBUG-66676 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenu.h')
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index 2b4cf0ef98..6db4e04c61 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -96,6 +96,8 @@ public:
void syncMenuItem_helper(QPlatformMenuItem *menuItem, bool menubarUpdate);
+ void setItemTargetAction(QCocoaMenuItem *item) const;
+
private:
QCocoaMenuItem *itemOrNull(int index) const;
void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem);