aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickshortcut.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/util/qquickshortcut.cpp')
-rw-r--r--src/quick/util/qquickshortcut.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/quick/util/qquickshortcut.cpp b/src/quick/util/qquickshortcut.cpp
index 36c6933af4..e6f66f7bf1 100644
--- a/src/quick/util/qquickshortcut.cpp
+++ b/src/quick/util/qquickshortcut.cpp
@@ -134,6 +134,37 @@ void QQuickShortcut::setSequence(const QVariant &sequence)
}
/*!
+ \qmlproperty string QtQuick::Shortcut::nativeText
+ \since 5.6
+
+ This property provides the shortcut's key sequence as a platform specific
+ string. This means that it will be shown translated, and on OS X it will
+ resemble a key sequence from the menu bar. It is best to display this text
+ to the user (for example, on a tooltip).
+
+ \sa sequence, portableText
+*/
+QString QQuickShortcut::nativeText() const
+{
+ return m_shortcut.toString(QKeySequence::NativeText);
+}
+
+/*!
+ \qmlproperty string QtQuick::Shortcut::portableText
+ \since 5.6
+
+ This property provides the shortcut's key sequence as a string in a
+ "portable" format, suitable for reading and writing to a file. In many
+ cases, it will look similar to the native text on Windows and X11.
+
+ \sa sequence, nativeText
+*/
+QString QQuickShortcut::portableText() const
+{
+ return m_shortcut.toString(QKeySequence::PortableText);
+}
+
+/*!
\qmlproperty bool QtQuick::Shortcut::enabled
This property holds whether the shortcut is enabled.