1/**************************************************************************** 2** 3** Copyright (C) 2016 The Qt Company Ltd. 4** Contact: https://www.qt.io/licensing/ 5** 6** This file is part of the documentation of the Qt Toolkit. 7** 8** $QT_BEGIN_LICENSE:FDL$ 9** Commercial License Usage 10** Licensees holding valid commercial Qt licenses may use this file in 11** accordance with the commercial license agreement provided with the 12** Software or, alternatively, in accordance with the terms contained in 13** a written agreement between you and The Qt Company. For licensing terms 14** and conditions see https://www.qt.io/terms-conditions. For further 15** information use the contact form at https://www.qt.io/contact-us. 16** 17** GNU Free Documentation License Usage 18** Alternatively, this file may be used under the terms of the GNU Free 19** Documentation License version 1.3 as published by the Free Software 20** Foundation and appearing in the file included in the packaging of 21** this file. Please review the following information to ensure 22** the GNU Free Documentation License version 1.3 requirements 23** will be met: https://www.gnu.org/licenses/fdl-1.3.html. 24** $QT_END_LICENSE$ 25** 26****************************************************************************/ 27 28/*! 29 \class QTestEventList 30 \inmodule QtTest 31 32 \brief The QTestEventList class provides a list of GUI events. 33 34 A QTestEventList can be populated with GUI events that can be 35 stored as test data for later usage, or be replayed on any 36 QWidget. QTestEventList provides convenience functions for populating 37 the list. 38 39 Example: 40 \snippet code/doc_src_qtestevent.cpp 0 41 42 The example above simulates the user entering the character \c a 43 followed by a backspace, waiting for 200 milliseconds and 44 repeating it. 45*/ 46 47/*! \fn QTestEventList::QTestEventList() 48 49 Constructs an empty QTestEventList. 50*/ 51 52/*! \fn QTestEventList::QTestEventList(const QTestEventList &other) 53 54 Constructs a new QTestEventList as a copy of \a other. 55*/ 56 57/*! \fn QTestEventList::~QTestEventList() 58 59 Empties the list and destroys all stored events. 60*/ 61 62/*! \fn void QTestEventList::clear() 63 64 Removes all events from the list. 65*/ 66 67/*! \fn void QTestEventList::addKeyClick(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 68 69 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. 70 71 \sa QTest::keyClick() 72*/ 73 74/*! \fn void QTestEventList::addKeyPress(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 75 76 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. 77 78 \sa QTest::keyPress() 79*/ 80 81/*! \fn void QTestEventList::addKeyRelease(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 82 83 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. 84 85 \sa QTest::keyRelease() 86 87*/ 88 89/*! \fn void QTestEventList::addKeyEvent(QTest::KeyAction action, Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 90 \internal 91*/ 92 93/*! \fn void QTestEventList::addKeyClick(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 94 95 \overload 96 97 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. 98 99 \sa QTest::keyClick() 100 101*/ 102 103/*! \fn void QTestEventList::addKeyPress(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 104 105 \overload 106 107 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. 108 109 \sa QTest::keyPress() 110*/ 111 112/*! \fn void QTestEventList::addKeyRelease(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 113 114 \overload 115 116 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. 117 118 \sa QTest::keyRelease() 119*/ 120 121/*! \fn void QTestEventList::addKeyClicks(const QString &keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 122 123 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. 124 125 \sa QTest::keyClicks() 126*/ 127 128/*! \fn void QTestEventList::addKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) 129 \internal 130*/ 131 132/*! \fn void QTestEventList::addDelay(int msecs) 133 134 Adds a \a msecs milliseconds delay. 135 136 \sa {QTest::qWait()} 137*/ 138 139/*! \fn void QTestEventList::simulate(QWidget *w) 140 141 Simulates the events from the list one by one on the widget \a w. 142 For an example, please read the \l QTestEventList class documentation. 143*/ 144 145/*! \fn void QTestEventList::addMousePress(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) 146 147 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. 148 149 \sa QTest::mousePress() 150*/ 151/*! \fn void QTestEventList::addMouseRelease(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) 152 153 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. 154 155 \sa QTest::mouseRelease() 156*/ 157/*! \fn void QTestEventList::addMouseClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) 158 159 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. 160 161 \sa QTest::mouseClick() 162*/ 163/*! \fn void QTestEventList::addMouseDClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) 164 165 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. 166 167 \sa QTest::mousePress() 168*/ 169/*! \fn void QTestEventList::addMouseMove(QPoint pos = QPoint(), int delay=-1) 170 171 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. 172 173 \sa QTest::mousePress() 174*/ 175