aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextedit/data/keys_shortcutoverride.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicktextedit/data/keys_shortcutoverride.qml')
-rw-r--r--tests/auto/quick/qquicktextedit/data/keys_shortcutoverride.qml34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktextedit/data/keys_shortcutoverride.qml b/tests/auto/quick/qquicktextedit/data/keys_shortcutoverride.qml
new file mode 100644
index 0000000000..24bd434830
--- /dev/null
+++ b/tests/auto/quick/qquicktextedit/data/keys_shortcutoverride.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.10
+
+Item {
+ width: 320
+ height: 200
+ property string who : "nobody"
+
+ Shortcut {
+ sequence: "Esc"
+ onActivated: who = "Shortcut"
+ }
+
+ TextEdit {
+ id: txt
+ x: 100
+ text: "enter text"
+ Keys.onShortcutOverride: {
+ who = "TextEdit"
+ event.accepted = (event.key === Qt.Key_Escape)
+ }
+ }
+
+ Rectangle {
+ objectName: "rectangle"
+ width: 90
+ height: width
+ focus: true
+ color: focus ? "red" : "gray"
+ Keys.onShortcutOverride: {
+ who = "Rectangle"
+ event.accepted = (event.key === Qt.Key_Escape)
+ }
+ }
+}