diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-01-03 18:14:27 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-01-04 15:49:11 +0100 |
commit | ba639edd276daca27aeac6c073984e688466f18c (patch) | |
tree | 3b78d2ab084dabc8c6158731e4bea55d3897ef85 /src/corelib/global/qnamespace.qdoc | |
parent | 9af5a70c55c9ec85113303fb48af405304335d1a (diff) |
Reflect QStyleHints in AA_DontShowShortcutsInContextMenus
There are two ways to override whether shortcuts (key sequences) should
be shown in menus, QStyleHints::::showShortcutsInContextMenus() and
the Qt::AA_DontShowShortcutsInContextMenus application attribute,
but only the latter is checked by our own menu implementations.
This was confusing, as overriding the style hint had no effect.
It makes sense for the QStyleHint to be based on the platform style
hint, but since we also allows overriding it, the logic in QGuiApp
that initializes Qt::AA_DontShowShortcutsInContextMenus should be
based on the QStyleHint.
Note that the inverse relationship is not maintained, as the app
attribute should not affect the style hints.
This creates a somewhat awkward situation in terms of when you need
to override the behavior, so we might consider deprecating one of
the options.
Fixes: QTBUG-109590
Task-number: QTBUG-69452
Change-Id: I366c17ff00fd8ae10553bbfb88d162ffd2c8040f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/global/qnamespace.qdoc')
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index ae0f728611..fc306f34c8 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -94,9 +94,11 @@ \value AA_DontShowShortcutsInContextMenus Actions with the Shortcut property won't be shown in any shortcut menus unless specifically set by the QAction::shortcutVisibleInContextMenu property. This value was added - in Qt 5.10, and defaults to the preference reported by the implementation - of QPlatformIntegration::styleHint. To override the platform integration, - set this attribute after QCoreApplication has been instantiated. + in Qt 5.10, and is by default based on the value reported by + QStyleHints::showShortcutsInContextMenus(). To override the default + behavior, set the style hint before QCoreApplication has been + instantiated, or set this attribute after QCoreApplication has + been instantiated. \value AA_NativeWindows Ensures that widgets have native windows. |