diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-03-10 16:55:04 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-03-14 05:29:22 +0000 |
commit | c2c3452ba5b4c32d0c2d5df9193bf89986623ab5 (patch) | |
tree | 66b567681989e166bc429f477ae7f13f9c844f75 /src/gui/kernel/qplatformtheme.cpp | |
parent | b6e3fd8ced2ae3629b73b78bf436d1a3ac4bccda (diff) |
Add new API to control whether shortcuts are shown in context menus
Shortcuts are universally not shown on macOS or mobile platforms, making
applications look very obviously out of place.
Windows and GNOME desktop environments almost never use them.
Only KDE appears to do so commonly; default accordingly.
Task-number: QTBUG-49435
Change-Id: Ieac4cee57b15a02be5258f3d07749af6316af62b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 878f656f2e..ebf65eda12 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -161,6 +161,8 @@ QT_BEGIN_NAMESPACE The default value is double the MouseDoubleClickDistance, or 10 logical pixels if that is not specified. + \value ShowShortcutsInContextMenus (bool) Whether to display shortcut key sequences in context menus. + \sa themeHint(), QStyle::pixelMetric() */ @@ -516,6 +518,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) return QVariant(QStringList()); case QPlatformTheme::StyleNames: return QVariant(QStringList()); + case QPlatformTheme::ShowShortcutsInContextMenus: + return QVariant(false); case TextCursorWidth: return QVariant(1); case DropShadow: |