From 11a2e0aa2dd921e16cbc80479dd3667dc62ff18a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 25 Sep 2017 13:43:05 +0200 Subject: Cocoa: Ensure menus for a dialog's menubar are validated correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenubar.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins/platforms/cocoa/qcocoamenubar.mm') 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 -- cgit v1.2.3