diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-05-27 10:58:26 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-06-07 17:14:14 +0200 |
commit | 68297195759492594ac4143b7f208e17fe6f594b (patch) | |
tree | 2a9658dfcad6a88b298763f3bf44ac4dc4520f40 /src/widgets/widgets/qwidgettextcontrol.cpp | |
parent | 33aa461ec96201a2d32ce4ec80319f75878fed60 (diff) |
macOS: allow Qt::AA_DontShowShortcutsInContextMenus overrides
Following the discussion in QTBUG-69452, the resulting change in
cc33dd079796437bafed8f42de7fbf8f17d19ec8, and the documentation of
QAction::shortcutVisibleInContextMenu, the intention is that the
attribute allows the overriding of the platform default.
However, QAction did ask both the attribute and the platform
integration, making the override impossible. Instead, ask only
the attribute, but default the value of the attribute to what the
platform integration provides.
[ChangeLog][QtGui][QAction] The shortcutVisibleInContextMenu property
defaults to the value of the Qt::AA_DontShowShortcutsInContextMenus
attribute, which in turn defaults to the platform integration. To
override the default, set the application attribute after
instantiating QApplication, or override the default for each
QAction instance.
Task-number: QTBUG-73990
Pick-to: 5.15 6.1
Change-Id: Iaba330913555d93d05efe1b3965a6aea39db5554
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/widgets/qwidgettextcontrol.cpp')
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index b9ed4f6c04..76029714d5 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -98,8 +98,7 @@ #include "private/qapplication_p.h" #include "private/qshortcutmap_p.h" #include <qkeysequence.h> -#define ACCEL_KEY(k) ((!QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus) \ - && QGuiApplication::styleHints()->showShortcutsInContextMenus()) \ +#define ACCEL_KEY(k) (!QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus) \ && !QGuiApplicationPrivate::instance()->shortcutMap.hasShortcutForKeySequence(k) ? \ QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString()) |