From cee63e2c17c8e83a4366741da0cbd5fc852e5835 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Tue, 6 Sep 2011 14:10:50 +0200 Subject: Cocoa: QMenu refactor. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change prepares for enabling native menus on OS X. Move code from src/widgets to cocoa: - qcocoaapplicaiton - qcocoaapplicaitondelegate - qcocoamenuloader - qcocoamenu - qmenu_mac - misc helpers to qcocoahelpers Create a QNSApplication and QCocoaApplicationDelegate at application startup. New Lighthouse API: - class QPlatformMenu - class QPlatformMenuBar - QPlatformIntegration::createPlatformMenu() - QPlatformIntegration::createPlatformMenuBar() Platforms that wants a native menu integration subclasses QPlatformMenu[|Bar] and implements the create function. The default implementation returns 0, which causes QMenu to use the standard Qt menus. This API is based on the current native menu abstraction that Mac, Wince and S60 uses in Qt 4. The main difference is that the platform classes are proper standalone classes and not #ifdeffed into QMenuPrivate. Change-Id: I3da41f80b0ae903a476937908b1f9b88014b7954 Reviewed-on: http://codereview.qt.nokia.com/4068 Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qplatformintegration_qpa.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/kernel/qplatformintegration_qpa.cpp') diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index 2beb0bb240..856ceab87c 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -227,6 +227,17 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const return 0; } +QPlatformMenu *QPlatformIntegration::createPlatformMenu(QMenu *menu) const +{ + Q_UNUSED(menu); + return 0; +} + +QPlatformMenuBar *QPlatformIntegration::createPlatformMenuBar(QMenuBar *menuBar) const +{ + Q_UNUSED(menuBar); + return 0; +} /*! Should be called by the implementation whenever a new screen is added. -- cgit v1.2.3