summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-11-09 08:43:03 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-15 12:49:40 (GMT)
commitd9de8ad5ddbdd86de463b5aa82e03a450762b816 (patch)
tree3dff11389b2793ae61c944ca7cbfe328a5e2e403
parent609684a4196ccb979b85293ae61c16dd9d7b4671 (diff)
downloadQt-d9de8ad5ddbdd86de463b5aa82e03a450762b816.zip
Qt-d9de8ad5ddbdd86de463b5aa82e03a450762b816.tar.gz
Qt-d9de8ad5ddbdd86de463b5aa82e03a450762b816.tar.bz2
When clicking on a menu item which has a sub menu it should not close
If you clicked on a menu with a submenu then it should do nothing as this is what the native behaviour is on Mac. Task-number: QTBUG-10706 Change-Id: I7c8898b4b35a8189e1a8270d8a528eb56c81aed7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
-rw-r--r--src/gui/widgets/qmenu_mac.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 37755f1..a70c287 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -1433,6 +1433,7 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action)
} else {
[item setSubmenu:subMenu];
}
+ [item setAction:nil];
#endif
} else { //respect some other items
#ifndef QT_MAC_USE_COCOA
@@ -1447,6 +1448,8 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action)
}
#else
[item setSubmenu:0];
+ if ([item action] == nil)
+ [item setAction:@selector(qtDispatcherToQAction:)];
// No key equivalent set for multiple key QKeySequence.
if (accel.count() == 1) {
[item setKeyEquivalent:keySequenceToKeyEqivalent(accel)];