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.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/cocoa/qcocoamenubar.h') diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h index a4ee531e91..a259147247 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.h +++ b/src/plugins/platforms/cocoa/qcocoamenubar.h @@ -71,6 +71,7 @@ public: QList merged() const; NSMenuItem *itemForRole(QPlatformMenuItem::MenuRole r); + QCocoaWindow *cocoaWindow() const; void syncMenu_helper(QPlatformMenu *menu, bool menubarUpdate); -- cgit v1.2.3