aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/testlib/TestCase.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-08 14:12:35 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-01-08 14:12:35 +0000
commitb7d55fa38441afa431481dd5c8d0aa2ff5f2c2cf (patch)
treeb06a205e47527abbd9902fed23199a0b82117bdd /src/imports/testlib/TestCase.qml
parentbfd1df3015404725d37a54bcb4ac3c24a87ce8c8 (diff)
parent9a38fdcf8f9b734808bb54422e306872f3bfa944 (diff)
Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev
Diffstat (limited to 'src/imports/testlib/TestCase.qml')
-rw-r--r--src/imports/testlib/TestCase.qml26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 0e7e09c65c..4bcc95df89 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -39,7 +39,7 @@
import QtQuick 2.0
import QtQuick.Window 2.0 // used for qtest_verifyItem
-import QtTest 1.1
+import QtTest 1.2
import "testlogger.js" as TestLogger
import Qt.test.qtestroot 1.0
@@ -57,7 +57,7 @@ import Qt.test.qtestroot 1.0
\code
import QtQuick 2.0
- import QtTest 1.0
+ import QtTest 1.2
TestCase {
name: "MathTests"
@@ -108,7 +108,7 @@ import Qt.test.qtestroot 1.0
\code
import QtQuick 2.0
- import QtTest 1.1
+ import QtTest 1.2
TestCase {
name: "DataTests"
@@ -1212,6 +1212,26 @@ Item {
}
/*!
+ \since 5.10
+ \qmlmethod TestCase::keySequence(keySequence)
+
+ Simulates typing of \a keySequence. The key sequence 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.
+
+ Each event shall be sent to the TestCase window or, in case of multiple windows,
+ to the current active window. See \l QGuiApplication::focusWindow() for more details.
+
+ \sa keyPress(), keyRelease(), {GNU Emacs Style Key Sequences},
+ {QtQuick::Shortcut::sequence}{Shortcut.sequence}
+ */
+ function keySequence(keySequence) {
+ if (!qtest_events.keySequence(keySequence))
+ qtest_fail("window not shown", 2)
+ }
+
+ /*!
\qmlmethod TestCase::mousePress(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
Simulates pressing a mouse \a button with an optional \a modifier