blob: 9887f10c2160238feaa17935aaaf8cee9e46faf2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick 2.8
import QtQuick.Window 2.2
import QtTest 1.2
TestCase {
name: "ShortCut"
when: windowShown
Shortcut {
id: shortcut
property bool everActivated: false
sequence: StandardKey.NextChild
onActivated: everActivated = true
}
Shortcut {
id: shortcut2
property bool everActivated: false
sequence: "Ctrl+E,Ctrl+W"
onActivated: everActivated = true
}
function test_shortcut() {
keySequence(StandardKey.NextChild)
verify(shortcut.everActivated);
keySequence("Ctrl+E,Ctrl+W")
verify(shortcut2.everActivated);
}
}
|