Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtestevent.qdoc
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \class QTestEventList
6 \inmodule QtTest
7
8 \brief The QTestEventList class provides a list of GUI events.
9
10 A QTestEventList can be populated with GUI events that can be
11 stored as test data for later usage, or be replayed on any
12 QWidget. QTestEventList provides convenience functions for populating
13 the list.
14
15 Example:
16 \snippet code/doc_src_qtestevent.cpp 0
17
18 The example above simulates the user entering the character \c a
19 followed by a backspace, waiting for 200 milliseconds and
20 repeating it.
21*/
22
23/*! \fn QTestEventList::QTestEventList()
24
25 Constructs an empty QTestEventList.
26*/
27
28/*! \fn QTestEventList::QTestEventList(const QTestEventList &other)
29
30 Constructs a new QTestEventList as a copy of \a other.
31*/
32
33/*! \fn QTestEventList::~QTestEventList()
34
35 Empties the list and destroys all stored events.
36*/
37
38/*! \fn void QTestEventList::clear()
39
40 Removes all events from the list.
41*/
42
43/*! \fn void QTestEventList::addKeyClick(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
44
45 Adds a new key click to the list. The event will simulate the key \a qtKey with the modifier \a modifiers and then wait for \a msecs milliseconds.
46
47 \sa QTest::keyClick()
48*/
49
50/*! \fn void QTestEventList::addKeyPress(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
51
52 Adds a new key press to the list. The event will press the key \a qtKey with the modifier \a modifiers and then wait for \a msecs milliseconds.
53
54 \sa QTest::keyPress()
55*/
56
57/*! \fn void QTestEventList::addKeyRelease(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
58
59 Adds a new key release to the list. The event will release the key \a qtKey with the modifier \a modifiers and then wait for \a msecs milliseconds.
60
61 \sa QTest::keyRelease()
62
63*/
64
65/*! \fn void QTestEventList::addKeyEvent(QTest::KeyAction action, Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
66 \internal
67*/
68
69/*! \fn void QTestEventList::addKeyClick(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
70
71 \overload
72
73 Adds a new key click to the list. The event will simulate the key \a ascii with the modifier \a modifiers and then wait for \a msecs milliseconds.
74
75 \sa QTest::keyClick()
76
77*/
78
79/*! \fn void QTestEventList::addKeyPress(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
80
81 \overload
82
83 Adds a new key press to the list. The event will press the key \a ascii with the modifier \a modifiers and then wait for \a msecs milliseconds.
84
85 \sa QTest::keyPress()
86*/
87
88/*! \fn void QTestEventList::addKeyRelease(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
89
90 \overload
91
92 Adds a new key release to the list. The event will release the key \a ascii with the modifier \a modifiers and then wait for \a msecs milliseconds.
93
94 \sa QTest::keyRelease()
95*/
96
97/*! \fn void QTestEventList::addKeyClicks(const QString &keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
98
99 Adds new keyboard entries to the list. The event will press the \a keys with the \a modifiers and wait \a msecs milliseconds between each key.
100
101 \sa QTest::keyClicks()
102*/
103
104/*! \fn void QTestEventList::addKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
105 \internal
106*/
107
108/*! \fn void QTestEventList::addDelay(int msecs)
109
110 Adds a \a msecs milliseconds delay.
111
112 \sa {QTest::qWait()}
113*/
114
115/*! \fn void QTestEventList::simulate(QWidget *w)
116
117 Simulates the events from the list one by one on the widget \a w.
118 For an example, please read the \l QTestEventList class documentation.
119*/
120
121/*! \fn void QTestEventList::addMousePress(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
122
123 Add a mouse press to the list. The event will press the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.
124
125 \sa QTest::mousePress()
126*/
127/*! \fn void QTestEventList::addMouseRelease(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
128
129 Add a mouse release to the list. The event will release the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.
130
131 \sa QTest::mouseRelease()
132*/
133/*! \fn void QTestEventList::addMouseClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
134
135 Add a mouse click to the list. The event will click the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.
136
137 \sa QTest::mouseClick()
138*/
139/*! \fn void QTestEventList::addMouseDClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
140
141 Add a double mouse click to the list. The event will double click the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.
142
143 \sa QTest::mousePress()
144*/
145/*! \fn void QTestEventList::addMouseMove(QPoint pos = QPoint(), int delay=-1)
146
147 Adds a mouse move to the list. The event will move the mouse to the position \a pos. If a \a delay (in milliseconds) is set, the test will wait after moving the mouse. The default position is the center of the widget.
148
149 \sa QTest::mousePress()
150*/