path: root/src/gui/kernel/qstylehints.cpp
diff options
authorJake Petroules <>2017-03-10 16:55:04 -0800
committerJake Petroules <>2017-03-14 05:29:22 +0000
commitc2c3452ba5b4c32d0c2d5df9193bf89986623ab5 (patch)
tree66b567681989e166bc429f477ae7f13f9c844f75 /src/gui/kernel/qstylehints.cpp
parentb6e3fd8ced2ae3629b73b78bf436d1a3ac4bccda (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 <>
Diffstat (limited to 'src/gui/kernel/qstylehints.cpp')
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 85c0768e35..0850228ee5 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -365,6 +365,17 @@ bool QStyleHints::showIsMaximized() const
+ \property QStyleHints::showShortcutsInContextMenus
+ \since 5.10
+ \brief \c true if the platform normally shows shortcut key sequences in
+ context menus, otherwise \c false.
+bool QStyleHints::showShortcutsInContextMenus() const
+ return themeableHint(QPlatformTheme::ShowShortcutsInContextMenus, QPlatformIntegration::ShowShortcutsInContextMenus).toBool();
\property QStyleHints::passwordMaskDelay
\brief the time, in milliseconds, a typed letter is displayed unshrouded
in a text input field in password mode.