IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QTestEventList Class

The https:// class provides a list of GUI events.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QTestEventList Class▲

  • Header: QTestEventList

  • qmake: QT += testlib

Detailed Description▲

A https:// can be populated with GUI events that can be stored as test data for later usage, or be replayed on any QWidget. https:// provides convenience functions for populating the list.

Example:

 
Sélectionnez
QTestEventList events;
events.addKeyClick('a');
events.addKeyClick(Qt::Key_Backspace);
events.addDelay(200);

QLineEdit *lineEdit = new QLineEdit(myParent);
...
events.simulate(lineEdit);
events.simulate(lineEdit);

The example above simulates the user entering the character a followed by a backspace, waiting for 200 milliseconds and repeating it.

Member Function Documentation▲

 

QTestEventList::QTestEventList()▲

Constructs an empty https://.

QTestEventList::QTestEventList(const QTestEventList &other)▲

Constructs a new https:// as a copy of other.

QTestEventList::~QTestEventList()▲

Empties the list and destroys all stored events.

void QTestEventList::addDelay(int msecs)▲

Adds a msecs milliseconds delay.

See Also▲

See also QTest::qWait()

void QTestEventList::addKeyClick(int qtKey, int modifiers = ..., int msecs = -1)▲

Adds a new key click to the list. The event will simulate the key qtKey with the modifier modifiers and then wait for msecs milliseconds.

See Also▲

See also https://()

void QTestEventList::addKeyClick(char ascii, int modifiers = ..., int msecs = -1)▲

This is an overloaded function.

Adds a new key click to the list. The event will simulate the key ascii with the modifier modifiers and then wait for msecs milliseconds.

See Also▲

See also https://()

void QTestEventList::addKeyClicks(const int &keys, int modifiers = ..., int msecs = -1)▲

Adds new keyboard entries to the list. The event will press the keys with the modifiers and wait msecs milliseconds between each key.

See Also▲

See also https://()

void QTestEventList::addKeyPress(int qtKey, int modifiers = ..., int msecs = -1)▲

Adds a new key press to the list. The event will press the key qtKey with the modifier modifiers and then wait for msecs milliseconds.

See Also▲

See also https://()

void QTestEventList::addKeyPress(char ascii, int modifiers = ..., int msecs = -1)▲

This is an overloaded function.

Adds a new key press to the list. The event will press the key ascii with the modifier modifiers and then wait for msecs milliseconds.

See Also▲

See also https://()

void QTestEventList::addKeyRelease(int qtKey, int modifiers = ..., int msecs = -1)▲

Adds a new key release to the list. The event will release the key qtKey with the modifier modifiers and then wait for msecs milliseconds.

See Also▲

See also https://()

void QTestEventList::addKeyRelease(char ascii, int modifiers = ..., int msecs = -1)▲

This is an overloaded function.

Adds a new key release to the list. The event will release the key ascii with the modifier modifiers and then wait for msecs milliseconds.

See Also▲

See also https://()

void QTestEventList::addMouseClick(int button, int modifiers = 0, int pos = QPoint(), int delay = -1)▲

Add a mouse click to the list. The event will click the button with optional modifiers at the position pos with an optional delay. The default position is the center of the widget.

See Also▲

See also https://()

void QTestEventList::addMouseDClick(int button, int modifiers = 0, int pos = QPoint(), int delay = -1)▲

Add a double mouse click to the list. The event will double click the button with optional modifiers at the position pos with an optional delay. The default position is the center of the widget.

See Also▲

See also https://()

void QTestEventList::addMouseMove(int pos = QPoint(), int delay = -1)▲

Adds a mouse move to the list. The event will move the mouse to the position pos. If a delay (in milliseconds) is set, the test will wait after moving the mouse. The default position is the center of the widget.

See Also▲

See also https://()

void QTestEventList::addMousePress(int button, int modifiers = 0, int pos = QPoint(), int delay = -1)▲

Add a mouse press to the list. The event will press the button with optional modifiers at the position pos with an optional delay. The default position is the center of the widget.

See Also▲

See also https://()

void QTestEventList::addMouseRelease(int button, int modifiers = 0, int pos = QPoint(), int delay = -1)▲

Add a mouse release to the list. The event will release the button with optional modifiers at the position pos with an optional delay. The default position is the center of the widget.

See Also▲

See also https://()

void QTestEventList::clear()▲

Removes all events from the list.

void QTestEventList::simulate(int *w)▲

Simulates the events from the list one by one on the widget w. For an example, please read the https:// class documentation.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.