diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-04-22 11:42:34 (GMT) |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-05-04 13:09:59 (GMT) |
commit | 1e0e67406c3865717fef8b98d2c69adbefc54245 (patch) | |
tree | e26996ae282fee233e12e7674373bc5c9336a8d4 /src/gui/kernel | |
parent | 4ac548735b1a62b2db344b5ee4ecc14207f1111d (diff) | |
download | Qt-1e0e67406c3865717fef8b98d2c69adbefc54245.zip Qt-1e0e67406c3865717fef8b98d2c69adbefc54245.tar.gz Qt-1e0e67406c3865717fef8b98d2c69adbefc54245.tar.bz2 |
Deprecate qt_mac_set_show_menubar for a public cross-platform API.
I'm tired of these "hidden" functions. We have an
AA_MacPluginApplication, but sometimes you may have a legitimate reason
for setting this outside of "plugin applications." In the footsteps of
the menu icon attribute, the attribute is the main leader, but menubars
can disable/enable this locally the new QMenuBar::setNativeMenuBar()
property. Otherwise, the menubars take their que from the application
attribute.
This also works for Windows CE. So, there is a bit on convergence as
well.
Task-number: 236757
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qaction.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_mac.mm | 4 | ||||
-rw-r--r-- | src/gui/kernel/qshortcutmap.cpp | 6 |
3 files changed, 3 insertions, 9 deletions
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index c6addc1..b2afbd0 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -1370,7 +1370,7 @@ QAction::MenuRole QAction::menuRole() const void QAction::setIconVisibleInMenu(bool visible) { Q_D(QAction); - if (visible != (bool)d->iconVisibleInMenu) { + if (d->iconVisibleInMenu == -1 || visible != bool(d->iconVisibleInMenu)) { int oldValue = d->iconVisibleInMenu; d->iconVisibleInMenu = visible; // Only send data changed if we really need to. diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index 8d0b2c1..d5fa9ea 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1196,10 +1196,6 @@ void qt_init(QApplicationPrivate *priv, int) [qtMenuLoader release]; } #endif - if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) { - extern void qt_mac_set_native_menubar(bool); - qt_mac_set_native_menubar(false); - } // Register for Carbon tablet proximity events on the event monitor target. // This means that we should receive proximity events even when we aren't the active application. if (!tablet_proximity_handler) { diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index ed9654b..b6703e2 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -61,8 +61,6 @@ QT_BEGIN_NAMESPACE -extern bool qt_mac_no_native_menubar; // qmenu_mac.cpp - // To enable verbose output uncomment below //#define DEBUG_QSHORTCUTMAP @@ -660,7 +658,7 @@ bool QShortcutMap::correctWidgetContext(Qt::ShortcutContext context, QWidget *w, { bool visible = w->isVisible(); #ifdef Q_WS_MAC - if (!qt_mac_no_native_menubar && qobject_cast<QMenuBar *>(w)) + if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w)) visible = true; #endif @@ -723,7 +721,7 @@ bool QShortcutMap::correctGraphicsWidgetContext(Qt::ShortcutContext context, QGr { bool visible = w->isVisible(); #ifdef Q_WS_MAC - if (!qt_mac_no_native_menubar && qobject_cast<QMenuBar *>(w)) + if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w)) visible = true; #endif |