diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 8 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qstylehints.cpp | 2 |
3 files changed, 8 insertions, 4 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. diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index e5144b514a..88d3a390aa 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1318,7 +1318,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString const auto platformIntegration = QGuiApplicationPrivate::platformIntegration(); fontSmoothingGamma = platformIntegration->styleHint(QPlatformIntegration::FontSmoothingGamma).toReal(); QCoreApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus, - !platformIntegration->styleHint(QPlatformIntegration::ShowShortcutsInContextMenus).toBool()); + !QGuiApplication::styleHints()->showShortcutsInContextMenus()); } static void init_plugins(const QList<QByteArray> &pluginList) diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 9bd686070d..5080bd7add 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -376,6 +376,8 @@ bool QStyleHints::showIsMaximized() const Since Qt 5.13, the setShowShortcutsInContextMenus() function can be used to override the platform default. + + \sa Qt::AA_DontShowShortcutsInContextMenus */ bool QStyleHints::showShortcutsInContextMenus() const { |