aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickshortcut_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@theqtcompany.com>2015-08-07 10:52:36 +0200
committerShawn Rutledge <shawn.rutledge@theqtcompany.com>2015-09-03 08:18:20 +0000
commit8b09653cb22807f09ec4e6c0ffc7dcf7f11bc1a0 (patch)
tree0d9e717ce1b2874d7a29da0df002980b0955c481 /src/quick/util/qquickshortcut_p.h
parent149ece7a0cfb4fc90fe4544379ee2772fde881fd (diff)
Shortcut: add sequenceString property
If you set sequence to a StandardKey, then read back the property, you will get an int, which is not suitable for display. Now you can use sequenceString for tooltips, preference dialogs for setting shortcuts, and such. [ChangeLog][QtQuick] Added Shortcut.sequenceString property to read back the key sequence as a displayable string Change-Id: I63ee46f8a2c2da1b1c803282baa894fb1667fe67 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Diffstat (limited to 'src/quick/util/qquickshortcut_p.h')
-rw-r--r--src/quick/util/qquickshortcut_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/util/qquickshortcut_p.h b/src/quick/util/qquickshortcut_p.h
index e16ac9df20..db02f8afae 100644
--- a/src/quick/util/qquickshortcut_p.h
+++ b/src/quick/util/qquickshortcut_p.h
@@ -57,6 +57,7 @@ class QQuickShortcut : public QObject, public QQmlParserStatus
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
Q_PROPERTY(QVariant sequence READ sequence WRITE setSequence NOTIFY sequenceChanged FINAL)
+ Q_PROPERTY(QString sequenceString READ sequenceString NOTIFY sequenceChanged FINAL REVISION 1)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL)
Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY autoRepeatChanged FINAL)
Q_PROPERTY(Qt::ShortcutContext context READ context WRITE setContext NOTIFY contextChanged FINAL)
@@ -68,6 +69,8 @@ public:
QVariant sequence() const;
void setSequence(const QVariant &sequence);
+ Q_REVISION(1) QString sequenceString() const;
+
bool isEnabled() const;
void setEnabled(bool enabled);