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/widgets/kernel/qaction.h | |
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/widgets/kernel/qaction.h')
-rw-r--r-- | src/widgets/kernel/qaction.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h index 97948a2457..d211016931 100644 --- a/src/widgets/kernel/qaction.h +++ b/src/widgets/kernel/qaction.h @@ -80,6 +80,7 @@ class Q_WIDGETS_EXPORT QAction : public QObject Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed) Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole NOTIFY changed) Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu NOTIFY changed) + Q_PROPERTY(bool shortcutVisibleInContextMenu READ isShortcutVisibleInContextMenu WRITE setShortcutVisibleInContextMenu NOTIFY changed) Q_PROPERTY(Priority priority READ priority WRITE setPriority) public: @@ -168,6 +169,8 @@ public: void setIconVisibleInMenu(bool visible); bool isIconVisibleInMenu() const; + void setShortcutVisibleInContextMenu(bool show); + bool isShortcutVisibleInContextMenu() const; QWidget *parentWidget() const; |