
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQTestEventList class provides a list of GUI events.More...
| Header: | #include <QTestEventList> |
| Inherits: | QList<QTestEvent *> |
| QTestEventList() | |
| QTestEventList(const QTestEventList & other) | |
| ~QTestEventList() | |
| void | addDelay(int msecs) |
| void | addKeyClick(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) |
| void | addKeyClick(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) |
| void | addKeyClicks(const QString & keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) |
| void | addKeyPress(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) |
| void | addKeyPress(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) |
| void | addKeyRelease(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) |
| void | addKeyRelease(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) |
| void | addMouseClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1) |
| void | addMouseDClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1) |
| void | addMouseMove(QPoint pos = QPoint(), int delay = -1) |
| void | addMousePress(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1) |
| void | addMouseRelease(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1) |
| void | clear() |
| void | simulate(QWidget * w) |
TheQTestEventList class provides a list of GUI events.
QTestEventList inherits fromQList<QTestEvent *>, and provides convenience functions for populating the list.
AQTestEventList can be populated with GUI events that can be stored as test data for later usage, or be replayed on anyQWidget.
Example:
QTestEventList events;events.addKeyClick('a');events.addKeyClick(Qt::Key_Backspace);events.addDelay(200);QLineEdit*lineEdit=newQLineEdit(myParent);...events.simulate(lineEdit);events.simulate(lineEdit);
The example above simulates the user entering the charactera followed by a backspace, waiting for 200 milliseconds and repeating it.
Constructs an emptyQTestEventList.
Constructs a newQTestEventList as a copy ofother.
Empties the list and destroys all stored events.
Adds amsecs milliseconds delay.
See alsoQTest::qWait().
Adds a new key click to the list. The event will simulate the keyqtKey with the modifiermodifiers and then wait formsecs milliseconds.
See alsoQTest::keyClick().
This is an overloaded function.
Adds a new key click to the list. The event will simulate the keyascii with the modifiermodifiers and then wait formsecs milliseconds.
See alsoQTest::keyClick().
Adds new keyboard entries to the list. The event will press thekeys with themodifiers and waitmsecs milliseconds between each key.
See alsoQTest::keyClicks().
Adds a new key press to the list. The event will press the keyqtKey with the modifiermodifiers and then wait formsecs milliseconds.
See alsoQTest::keyPress().
This is an overloaded function.
Adds a new key press to the list. The event will press the keyascii with the modifiermodifiers and then wait formsecs milliseconds.
See alsoQTest::keyPress().
Adds a new key release to the list. The event will release the keyqtKey with the modifiermodifiers and then wait formsecs milliseconds.
See alsoQTest::keyRelease().
This is an overloaded function.
Adds a new key release to the list. The event will release the keyascii with the modifiermodifiers and then wait formsecs milliseconds.
See alsoQTest::keyRelease().
Add a mouse click to the list. The event will click thebutton with optionalmodifiers at the positionpos with an optionaldelay. The default position is the center of the widget.
See alsoQTest::mouseClick().
Add a double mouse click to the list. The event will double click thebutton with optionalmodifiers at the positionpos with an optionaldelay. The default position is the center of the widget.
See alsoQTest::mousePress().
Adds a mouse move to the list. The event will move the mouse to the positionpos. If adelay (in milliseconds) is set, the test will wait after moving the mouse. The default position is the center of the widget.
See alsoQTest::mousePress().
Add a mouse press to the list. The event will press thebutton with optionalmodifiers at the positionpos with an optionaldelay. The default position is the center of the widget.
See alsoQTest::mousePress().
Add a mouse release to the list. The event will release thebutton with optionalmodifiers at the positionpos with an optionaldelay. The default position is the center of the widget.
See alsoQTest::mouseRelease().
Removes all events from the list.
Simulates the events from the list one by one on the widgetw. For an example, please read theQTestEventList class documentation.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.