summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorJames Turner <james.turner@kdab.com>2012-02-27 13:04:45 +0000
committerQt by Nokia <qt-info@nokia.com>2012-05-19 01:45:04 +0200
commit1f55af8e54dc4841441ab1adf7759baace9452fa (patch)
tree42beff251511100aad43ad31fdb276d67b43e59f /src/plugins/platforms/cocoa
parent864e9963843f209f61c72123df05743bcbf1e139 (diff)
QPA menu abstraction, originally based on Morten's work
Create a QPA abstraction for native menus, derived from the Cocoa support in 4.8, but with the expectation to support other platforms too. Update the QtWidget QMenu and QMenuBar code to maintain their QPA equivalents if they exist. Change-Id: Id605de3da8811dc832bf48b35f9107778ad320ff Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuloader.mm9
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm14
5 files changed, 8 insertions, 23 deletions
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index ccd98c5b3c..313b666793 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -17,8 +17,6 @@ OBJECTIVE_SOURCES += main.mm \
qcocoamenuloader.mm \
qcocoaapplicationdelegate.mm \
qcocoaapplication.mm \
- qcocoamenu.mm \
- qmenu_mac.mm \
qcocoahelpers.mm \
qmultitouch_mac.mm \
qcocoaaccessibilityelement.mm \
@@ -51,8 +49,6 @@ HEADERS += qcocoaintegration.h \
qcocoamenuloader.h \
qcocoaapplicationdelegate.h \
qcocoaapplication.h \
- qcocoamenu.h \
- qmenu_mac.h \
qcocoahelpers.h \
qmultitouch_mac_p.h \
qcocoaaccessibilityelement.h \
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index b82519fd97..9b575afbb2 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -49,7 +49,6 @@
#include "qcocoahelpers.h"
#include "qcocoaapplication.h"
#include "qcocoaapplicationdelegate.h"
-#include "qmenu_mac.h"
#include "qcocoafiledialoghelper.h"
#include "qcocoatheme.h"
#include "qcocoainputcontext.h"
diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm
index 2fdc28de1e..7854a83253 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm
@@ -41,7 +41,6 @@
#include "qcocoamenuloader.h"
-#include "qmenu_mac.h"
#include "qcocoahelpers.h"
#include <QtCore/private/qcore_mac_p.h>
@@ -272,15 +271,17 @@ void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader)
- (void)qtUpdateMenubar
{
+#if 0
QCocoaMenuBar::macUpdateMenuBarImmediatly();
+#endif
}
- (void)qtTranslateApplicationMenu
{
qDebug() << "qtTranslateApplicationMenu";
-
-#ifndef QT_NO_TRANSLATION
+#if 0
+ //#ifndef QT_NO_TRANSLATION
[servicesItem setTitle: QCFString::toNSString(qt_mac_applicationmenu_string(0))];
[hideItem setTitle: QCFString::toNSString(qt_mac_applicationmenu_string(1).arg(qt_mac_applicationName()))];
[hideAllOthersItem setTitle: QCFString::toNSString(qt_mac_applicationmenu_string(2))];
@@ -293,6 +294,7 @@ void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader)
- (IBAction)qtDispatcherToQAction:(id)sender
{
+#if 0
//
//QScopedLoopLevelCounter loopLevelCounter(QApplicationPrivate::instance()->threadData);
NSMenuItem *item = static_cast<NSMenuItem *>(sender);
@@ -304,6 +306,7 @@ void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader)
// normal QApplication::quit().
qApp->quit();
}
+#endif
}
- (void)orderFrontCharacterPalette:(id)sender
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.h b/src/plugins/platforms/cocoa/qcocoatheme.h
index 791f1d4a50..d126050f98 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.h
+++ b/src/plugins/platforms/cocoa/qcocoatheme.h
@@ -54,9 +54,6 @@ public:
QCocoaTheme();
~QCocoaTheme();
- QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const;
- QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const;
-
bool usePlatformNativeDialog(DialogType dialogType) const;
QPlatformDialogHelper *createPlatformDialogHelper(DialogType dialogType) const;
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index d17ee30096..cfb146ad45 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -41,7 +41,8 @@
#include "qcocoatheme.h"
-#include "qmenu_mac.h"
+#include <QVariant>
+
#include "qcocoacolordialoghelper.h"
#include "qcocoafiledialoghelper.h"
#include "qcocoafontdialoghelper.h"
@@ -62,17 +63,6 @@ QCocoaTheme::~QCocoaTheme()
delete m_systemPalette;
}
-QPlatformMenu *QCocoaTheme::createPlatformMenu(QMenu *menu) const
-{
- return new QCocoaMenu(menu);
-}
-
-QPlatformMenuBar *QCocoaTheme::createPlatformMenuBar(QMenuBar *menuBar) const
-{
- return new QCocoaMenuBar(menuBar);
-}
-
-
bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const
{
if (dialogType == QPlatformTheme::FileDialog)