Doc: Address some "No documentation for..." warnings in QTest

Task-number: QTBUG-36985
Change-Id: I811b4711edc3420911fcd706ecef2d090f41bc89
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
This commit is contained in:
Jason McDonald 2014-02-22 17:15:09 +10:00 committed by The Qt Project
parent 300be65b16
commit 3b1e9a7f9b
2 changed files with 227 additions and 25 deletions

View File

@ -260,5 +260,16 @@ void TestBenchmark::simple()
} }
//! [27] //! [27]
//! [28]
QTest::keyClick(myWindow, 'a');
//! [28]
//! [29]
QTest::keyClick(myWindow, Qt::Key_Escape);
QTest::keyClick(myWindow, Qt::Key_Escape, Qt::ShiftModifier, 200);
//! [29]
} }

View File

@ -567,23 +567,6 @@ QT_BEGIN_NAMESPACE
\value MouseMove The mouse pointer has moved. \value MouseMove The mouse pointer has moved.
*/ */
/*! \fn void QTest::keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
Simulates clicking of \a key with an optional \a modifier on a \a widget.
If \a delay is larger than 0, the test will wait for \a delay milliseconds
before clicking the key.
Example:
\snippet code/src_qtestlib_qtestcase.cpp 13
The example above simulates clicking \c a on \c myWidget without
any keyboard modifiers and without delay of the test.
\sa QTest::keyClicks()
*/
/*! \fn void QTest::keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
Simulates clicking of \a key with an optional \a modifier on a \a widget. Simulates clicking of \a key with an optional \a modifier on a \a widget.
@ -601,6 +584,58 @@ QT_BEGIN_NAMESPACE
\sa QTest::keyClicks() \sa QTest::keyClicks()
*/ */
/*! \fn void QTest::keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
Simulates clicking of \a key with an optional \a modifier on a \a widget.
If \a delay is larger than 0, the test will wait for \a delay milliseconds
before clicking the key.
Example:
\snippet code/src_qtestlib_qtestcase.cpp 13
The example above simulates clicking \c a on \c myWidget without
any keyboard modifiers and without delay of the test.
\sa QTest::keyClicks()
*/
/*! \fn void QTest::keyClick(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Simulates clicking of \a key with an optional \a modifier on a \a window.
If \a delay is larger than 0, the test will wait for \a delay milliseconds
before clicking the key.
Examples:
\snippet code/src_qtestlib_qtestcase.cpp 29
The first example above simulates clicking the \c escape key on \c
myWindow without any keyboard modifiers and without delay. The
second example simulates clicking \c shift-escape on \c myWindow
following a 200 ms delay of the test.
\sa QTest::keyClicks()
*/
/*! \fn void QTest::keyClick(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Simulates clicking of \a key with an optional \a modifier on a \a window.
If \a delay is larger than 0, the test will wait for \a delay milliseconds
before clicking the key.
Example:
\snippet code/src_qtestlib_qtestcase.cpp 28
The example above simulates clicking \c a on \c myWindow without
any keyboard modifiers and without delay of the test.
\sa QTest::keyClicks()
*/
/*! \fn void QTest::keyEvent(KeyAction action, QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyEvent(KeyAction action, QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
Sends a Qt key event to \a widget with the given \a key and an associated \a action. Sends a Qt key event to \a widget with the given \a key and an associated \a action.
@ -609,13 +644,29 @@ QT_BEGIN_NAMESPACE
*/ */
/*! \fn void QTest::keyEvent(KeyAction action, QWidget *widget, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyEvent(KeyAction action, QWidget *widget, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload \overload
Sends a Qt key event to \a widget with the given key \a ascii and an associated \a action. Sends a Qt key event to \a widget with the given key \a ascii and an associated \a action.
Optionally, a keyboard \a modifier can be specified, as well as a \a delay Optionally, a keyboard \a modifier can be specified, as well as a \a delay
(in milliseconds) of the test before sending the event. (in milliseconds) of the test before sending the event.
*/
/*! \fn void QTest::keyEvent(KeyAction action, QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Sends a Qt key event to \a window with the given \a key and an associated \a action.
Optionally, a keyboard \a modifier can be specified, as well as a \a delay
(in milliseconds) of the test before sending the event.
*/
/*! \fn void QTest::keyEvent(KeyAction action, QWindow *window, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Sends a Qt key event to \a window with the given key \a ascii and an associated \a action.
Optionally, a keyboard \a modifier can be specified, as well as a \a delay
(in milliseconds) of the test before sending the event.
*/ */
/*! \fn void QTest::keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
@ -629,7 +680,6 @@ QT_BEGIN_NAMESPACE
*/ */
/*! \fn void QTest::keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload \overload
Simulates pressing a \a key with an optional \a modifier on a \a widget. Simulates pressing a \a key with an optional \a modifier on a \a widget.
@ -641,6 +691,31 @@ QT_BEGIN_NAMESPACE
\sa QTest::keyRelease(), QTest::keyClick() \sa QTest::keyRelease(), QTest::keyClick()
*/ */
/*! \fn void QTest::keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Simulates pressing a \a key with an optional \a modifier on a \a window. If \a delay
is larger than 0, the test will wait for \a delay milliseconds before pressing the key.
\b {Note:} At some point you should release the key using \l keyRelease().
\sa QTest::keyRelease(), QTest::keyClick()
*/
/*! \fn void QTest::keyPress(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Simulates pressing a \a key with an optional \a modifier on a \a window.
If \a delay is larger than 0, the test will wait for \a delay milliseconds
before pressing the key.
\b {Note:} At some point you should release the key using \l keyRelease().
\sa QTest::keyRelease(), QTest::keyClick()
*/
/*! \fn void QTest::keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
Simulates releasing a \a key with an optional \a modifier on a \a widget. Simulates releasing a \a key with an optional \a modifier on a \a widget.
@ -651,7 +726,6 @@ QT_BEGIN_NAMESPACE
*/ */
/*! \fn void QTest::keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload \overload
Simulates releasing a \a key with an optional \a modifier on a \a widget. Simulates releasing a \a key with an optional \a modifier on a \a widget.
@ -661,6 +735,27 @@ QT_BEGIN_NAMESPACE
\sa QTest::keyClick() \sa QTest::keyClick()
*/ */
/*! \fn void QTest::keyRelease(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Simulates releasing a \a key with an optional \a modifier on a \a window.
If \a delay is larger than 0, the test will wait for \a delay milliseconds
before releasing the key.
\sa QTest::keyPress(), QTest::keyClick()
*/
/*! \fn void QTest::keyRelease(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
\overload
\since 5.0
Simulates releasing a \a key with an optional \a modifier on a \a window.
If \a delay is larger than 0, the test will wait for \a delay milliseconds
before releasing the key.
\sa QTest::keyClick()
*/
/*! \fn void QTest::keyClicks(QWidget *widget, const QString &sequence, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) /*! \fn void QTest::keyClicks(QWidget *widget, const QString &sequence, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
@ -679,6 +774,18 @@ QT_BEGIN_NAMESPACE
\sa QTest::keyClick() \sa QTest::keyClick()
*/ */
/*! \fn void QTest::waitForEvents()
\internal
*/
/*! \fn void QTest::mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
\internal
*/
/*! \fn void QTest::mouseEvent(MouseAction action, QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
\internal
*/
/*! \fn void QTest::mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1)
Simulates pressing a mouse \a button with an optional \a modifier Simulates pressing a mouse \a button with an optional \a modifier
@ -690,6 +797,19 @@ QT_BEGIN_NAMESPACE
\sa QTest::mouseRelease(), QTest::mouseClick() \sa QTest::mouseRelease(), QTest::mouseClick()
*/ */
/*! \fn void QTest::mousePress(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1)
\overload
\since 5.0
Simulates pressing a mouse \a button with an optional \a stateKey modifier
on a \a window. The position is defined by \a pos; the default
position is the center of the window. If \a delay is specified,
the test will wait for the specified amount of milliseconds before
the press.
\sa QTest::mouseRelease(), QTest::mouseClick()
*/
/*! \fn void QTest::mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1)
Simulates releasing a mouse \a button with an optional \a modifier Simulates releasing a mouse \a button with an optional \a modifier
@ -701,6 +821,19 @@ QT_BEGIN_NAMESPACE
\sa QTest::mousePress(), QTest::mouseClick() \sa QTest::mousePress(), QTest::mouseClick()
*/ */
/*! \fn void QTest::mouseRelease(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1)
\overload
\since 5.0
Simulates releasing a mouse \a button with an optional \a stateKey modifier
on a \a window. The position of the release is defined by \a pos;
the default position is the center of the window. If \a delay is
specified, the test will wait for the specified amount of
milliseconds before releasing the button.
\sa QTest::mousePress(), QTest::mouseClick()
*/
/*! \fn void QTest::mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1)
Simulates clicking a mouse \a button with an optional \a modifier Simulates clicking a mouse \a button with an optional \a modifier
@ -712,6 +845,19 @@ QT_BEGIN_NAMESPACE
\sa QTest::mousePress(), QTest::mouseRelease() \sa QTest::mousePress(), QTest::mouseRelease()
*/ */
/*! \fn void QTest::mouseClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1)
\overload
\since 5.0
Simulates clicking a mouse \a button with an optional \a stateKey modifier
on a \a window. The position of the click is defined by \a pos;
the default position is the center of the window. If \a delay is
specified, the test will wait for the specified amount of
milliseconds before pressing and before releasing the button.
\sa QTest::mousePress(), QTest::mouseRelease()
*/
/*! \fn void QTest::mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1)
Simulates double clicking a mouse \a button with an optional \a Simulates double clicking a mouse \a button with an optional \a
@ -723,6 +869,19 @@ QT_BEGIN_NAMESPACE
\sa QTest::mouseClick() \sa QTest::mouseClick()
*/ */
/*! \fn void QTest::mouseDClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1)
\overload
\since 5.0
Simulates double clicking a mouse \a button with an optional \a stateKey
modifier on a \a window. The position of the click is defined by
\a pos; the default position is the center of the window. If \a
delay is specified, the test will wait for the specified amount of
milliseconds before each press and release.
\sa QTest::mouseClick()
*/
/*! \fn void QTest::mouseMove(QWidget *widget, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseMove(QWidget *widget, QPoint pos = QPoint(), int delay=-1)
Moves the mouse pointer to a \a widget. If \a pos is not Moves the mouse pointer to a \a widget. If \a pos is not
@ -731,6 +890,16 @@ QT_BEGIN_NAMESPACE
moving the mouse pointer. moving the mouse pointer.
*/ */
/*! \fn void QTest::mouseMove(QWindow *window, QPoint pos = QPoint(), int delay=-1)
\overload
\since 5.0
Moves the mouse pointer to a \a window. If \a pos is not
specified, the mouse pointer moves to the center of the window. If
a \a delay (in milliseconds) is given, the test will wait before
moving the mouse pointer.
*/
/*! /*!
\fn char *QTest::toString(const T &value) \fn char *QTest::toString(const T &value)
@ -2448,6 +2617,9 @@ static inline bool isWindowsBuildDirectory(const QString &dirName)
} }
#endif #endif
/*! \internal
*/
QString QTest::qFindTestData(const QString& base, const char *file, int line, const char *builddir) QString QTest::qFindTestData(const QString& base, const char *file, int line, const char *builddir)
{ {
QString found; QString found;
@ -2745,6 +2917,14 @@ bool QTest::qCompare(double const &t1, double const &t2, const char *actual, con
toString(t1), toString(t2), actual, expected, file, line); toString(t1), toString(t2), actual, expected, file, line);
} }
/*! \fn bool QTest::qCompare(double const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line)
\internal
*/
/*! \fn bool QTest::qCompare(float const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line)
\internal
*/
#define TO_STRING_IMPL(TYPE, FORMAT) \ #define TO_STRING_IMPL(TYPE, FORMAT) \
template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE >(const TYPE &t) \ template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE >(const TYPE &t) \
{ \ { \
@ -2807,12 +2987,11 @@ bool QTest::compare_string_helper(const char *t1, const char *t2, const char *ac
\internal \internal
*/ */
/*! \fn bool QTest::qCompare(QIcon const &t1, QIcon const &t2, const char *actual, const char *expected, const char *file, int line)
/*! \fn void QTest::mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
\internal \internal
*/ */
/*! \fn bool QTest::qCompare(QIcon const &t1, QIcon const &t2, const char *actual, const char *expected, const char *file, int line) /*! \fn bool QTest::qCompare(QImage const &t1, QImage const &t2, const char *actual, const char *expected, const char *file, int line)
\internal \internal
*/ */
@ -2916,12 +3095,24 @@ bool QTest::compare_string_helper(const char *t1, const char *t2, const char *ac
\internal \internal
*/ */
/*! \fn void QTest::sendKeyEvent(KeyAction action, QWindow *window, Qt::Key code, QString text, Qt::KeyboardModifiers modifier, int delay=-1)
\internal
*/
/*! \fn void QTest::sendKeyEvent(KeyAction action, QWidget *widget, Qt::Key code, char ascii, Qt::KeyboardModifiers modifier, int delay=-1) /*! \fn void QTest::sendKeyEvent(KeyAction action, QWidget *widget, Qt::Key code, char ascii, Qt::KeyboardModifiers modifier, int delay=-1)
\internal \internal
*/ */
/*! \fn void QTest::sendKeyEvent(KeyAction action, QWindow *window, Qt::Key code, char ascii, Qt::KeyboardModifiers modifier, int delay=-1)
\internal
*/
/*! \fn void QTest::simulateEvent(QWidget *widget, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1) /*! \fn void QTest::simulateEvent(QWidget *widget, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1)
\internal \internal
*/ */
/*! \fn void QTest::simulateEvent(QWindow *window, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1)
\internal
*/
QT_END_NAMESPACE QT_END_NAMESPACE