aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-01-22 11:32:48 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-01-22 11:55:32 +0000
commit0dbbfc2f2824aa3891fde0b219fb4951e94a64c9 (patch)
treef735f11050201208149cfc17dfc58767e9ac155f /tests
parentdeb779cdbaeeaea52ca0e99c9295db587c25f41c (diff)
Fix Action shortcuts in Repeater
QQuickRepeater does not set a QObject-parent, so make QQuickShortcutContext::matcher() start from the object itself and if no window is found, then iterate to the QObject parents. Task-number: QTBUG-65889 Change-Id: I30a1ed0616edd002abcf28d1b8dc7e2d87e99c13 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_action.qml28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_action.qml b/tests/auto/controls/data/tst_action.qml
index 7d057c26..35e65202 100644
--- a/tests/auto/controls/data/tst_action.qml
+++ b/tests/auto/controls/data/tst_action.qml
@@ -137,4 +137,32 @@ TestCase {
keyClick(Qt.Key_B, Qt.ControlModifier)
compare(container.lastSource, container.action)
}
+
+ Component {
+ id: actionAndRepeater
+ Item {
+ property alias action: testAction
+ Action {
+ id: testAction
+ shortcut: "Ctrl+A"
+ }
+ Repeater {
+ model: 1
+ Button {
+ action: testAction
+ }
+ }
+ }
+ }
+
+ function test_repeater() {
+ var container = createTemporaryObject(actionAndRepeater, testCase)
+ verify(container)
+
+ var spy = signalSpy.createObject(container, {target: container.action, signalName: "triggered"})
+ verify(spy.valid)
+
+ keyClick(Qt.Key_A, Qt.ControlModifier)
+ compare(spy.count, 1)
+ }
}