summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenubar.mm
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-09-25 13:43:05 +0200
committerAndy Shaw <andy.shaw@qt.io>2017-12-01 10:11:18 +0000
commit11a2e0aa2dd921e16cbc80479dd3667dc62ff18a (patch)
treedc133b165e349ac4decbc97d5abdb3c339e7cb62 /src/plugins/platforms/cocoa/qcocoamenubar.mm
parent673762b02e4d112198501e91ab487b04a1ed3a39 (diff)
Cocoa: Ensure menus for a dialog's menubar are validated correctly
Although the items were enabled for a dialog's menubar they were not appearing as such because Cocoa will query the menu item's target to see if it has a worksWhenModal selector. Therefore to ensure that the menu item will be enabled, we need to add this selector to our delegate and return YES from it when the window for the menubar is the dialog. Task-number: QTBUG-44584 Change-Id: Ic62dc027d563069d2f5c2b7bf9810184bd76de39 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenubar.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index a4cd465dae..cf9553bcf7 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -452,5 +452,10 @@ NSMenuItem *QCocoaMenuBar::itemForRole(QPlatformMenuItem::MenuRole r)
return Q_NULLPTR;
}
+QCocoaWindow *QCocoaMenuBar::cocoaWindow() const
+{
+ return m_window.data();
+}
+
QT_END_NAMESPACE