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.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/quick/util/qquickshortcut.cpp b/src/quick/util/qquickshortcut.cpp
index 51de063090..a6a0972d87 100644
--- a/src/quick/util/qquickshortcut.cpp
+++ b/src/quick/util/qquickshortcut.cpp
@@ -18,8 +18,9 @@
\ingroup qtquick-input
\brief Provides keyboard shortcuts.
- The Shortcut type provides a way of handling keyboard shortcuts. The shortcut can
- be set to one of the \l{QKeySequence::StandardKey}{standard keyboard shortcuts},
+ The Shortcut type lets you handle keyboard shortcuts. The shortcut can
+ be set to one of the
+ \l{QKeySequence::StandardKey}{standard keyboard shortcuts},
or it can be described with a string containing a sequence of up to four key
presses that are needed to \l{Shortcut::activated}{activate} the shortcut.
@@ -30,7 +31,7 @@
property int currentIndex
Shortcut {
- sequence: StandardKey.NextChild
+ sequences: [StandardKey.NextChild]
onActivated: view.currentIndex++
}
}
@@ -76,12 +77,12 @@ typedef bool (*ContextMatcher)(QObject *, Qt::ShortcutContext);
Q_GLOBAL_STATIC_WITH_ARGS(ContextMatcher, ctxMatcher, (qQuickShortcutContextMatcher))
-Q_QUICK_PRIVATE_EXPORT ContextMatcher qt_quick_shortcut_context_matcher()
+Q_QUICK_EXPORT ContextMatcher qt_quick_shortcut_context_matcher()
{
return *ctxMatcher();
}
-Q_QUICK_PRIVATE_EXPORT void qt_quick_set_shortcut_context_matcher(ContextMatcher matcher)
+Q_QUICK_EXPORT void qt_quick_set_shortcut_context_matcher(ContextMatcher matcher)
{
if (!ctxMatcher.isDestroyed())
*ctxMatcher() = matcher;
@@ -147,6 +148,10 @@ QQuickShortcut::~QQuickShortcut()
}
\endqml
+ \note Given that standard keys can resolve to one shortcut on some
+ platforms, but multiple shortcuts on other platforms, we recommend always
+ using \l{Shortcut::}{sequences} for standard keys.
+
\sa sequences
*/
QVariant QQuickShortcut::sequence() const
@@ -319,10 +324,11 @@ void QQuickShortcut::setAutoRepeat(bool repeat)
This property holds the \l{Qt::ShortcutContext}{shortcut context}.
Supported values are:
- \list
- \li \c Qt.WindowShortcut (default) - The shortcut is active when its parent item is in an active top-level window.
- \li \c Qt.ApplicationShortcut - The shortcut is active when one of the application's windows are active.
- \endlist
+
+ \value Qt.WindowShortcut
+ (default) The shortcut is active when its parent item is in an active top-level window.
+ \value Qt.ApplicationShortcut
+ The shortcut is active when one of the application's windows are active.
\qml
Shortcut {