Notice: Undefined offset: 1 in /home/developpez/www/developpez-com/upload/qt/doc/redir.php on line 39 Qt 4.7: QTestEventList Class Reference
Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QTestEventList Class Reference

The QTestEventList class provides a list of GUI events. More...

 #include <QTestEventList>

Inherits: QList<QTestEvent *>.

Public Functions

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 )
  • 66 public functions inherited from QList

Additional Inherited Members

  • 3 static public members inherited from QList

Detailed Description

The QTestEventList class provides a list of GUI events.

QTestEventList inherits from QList<QTestEvent *>, and provides convenience functions for populating the list.

A QTestEventList can be populated with GUI events that can be stored as test data for later usage, or be replayed on any QWidget.

Example:

 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 QTestEventList.

QTestEventList::QTestEventList ( const QTestEventList & other )

Constructs a new QTestEventList 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 QTest::qWait().

void QTestEventList::addKeyClick ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, 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 QTest::keyClick().

void QTestEventList::addKeyClick ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, 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 QTest::keyClick().

void QTestEventList::addKeyClicks ( const QString & keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, 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 QTest::keyClicks().

void QTestEventList::addKeyPress ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, 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 QTest::keyPress().

void QTestEventList::addKeyPress ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, 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 QTest::keyPress().

void QTestEventList::addKeyRelease ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, 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 QTest::keyRelease().

void QTestEventList::addKeyRelease ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, 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 QTest::keyRelease().

void QTestEventList::addMouseClick ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint 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 QTest::mouseClick().

void QTestEventList::addMouseDClick ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint 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 QTest::mousePress().

void QTestEventList::addMouseMove ( QPoint 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 QTest::mousePress().

void QTestEventList::addMousePress ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint 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 QTest::mousePress().

void QTestEventList::addMouseRelease ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint 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 QTest::mouseRelease().

void QTestEventList::clear ()

Removes all events from the list.

void QTestEventList::simulate ( QWidget * w )

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

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Labs au hasard

Logo

Utiliser OpenCL avec Qt

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.7
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web