diff options
Diffstat (limited to 'src/testlib/qtestcase.qdoc')
-rw-r--r-- | src/testlib/qtestcase.qdoc | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc index 8f3d140add..5b90419e28 100644 --- a/src/testlib/qtestcase.qdoc +++ b/src/testlib/qtestcase.qdoc @@ -82,11 +82,6 @@ QCOMPARE tries to output the contents of the values if the comparison fails, so it is visible from the test log why the comparison failed. - QCOMPARE is very strict on the data types. Both \a actual and \a expected - have to be of the same type, otherwise the test won't compile. This prohibits - unspecified behavior from being introduced; that is behavior that usually - occurs when the compiler implicitly casts the argument. - For your own classes, you can use \l QTest::toString() to format values for outputting into the test log. @@ -575,6 +570,15 @@ \sa QTest::keyClicks() */ +/*! \fn void QTest::keySequence(QWidget *widget, const QKeySequence &keySequence) + \overload + \since 5.10 + + Simulates typing of \a keySequence into a \a widget. + + \sa QTest::keyClick(), QTest::keyClicks() +*/ + /*! \fn void QTest::keyClick(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) \overload \since 5.0 @@ -611,6 +615,15 @@ \sa QTest::keyClicks() */ +/*! \fn void QTest::keySequence(QWindow *window, const QKeySequence &keySequence) + \overload + \since 5.10 + + Simulates typing of \a keySequence into a \a window. + + \sa QTest::keyClick(), QTest::keyClicks() +*/ + /*! \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. @@ -1062,6 +1075,21 @@ \sa QTest::qSleep(), QSignalSpy::wait() */ +/*! \fn void QTest::qWaitFor(Functor predicate, int timeout) + + Waits for \a timeout milliseconds or until the \a predicate returns true. + + Returns \c true if the \a predicate returned true at any point, otherwise returns \c false. + + Example: + \snippet code/src_qtestlib_qtestcase.cpp 30 + + The code above will wait for the object to become ready, for a + maximum of three seconds. + + \since 5.10 +*/ + /*! \fn bool QTest::qWaitForWindowExposed(QWindow *window, int timeout) \since 5.0 @@ -1071,6 +1099,10 @@ This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some time after being asked to show itself on the screen. + Note that a window that is mapped to screen may still not be considered exposed if the window client + area is completely covered by other windows, or if the window is otherwise not visible. This function + will then time out when waiting for such a window. + \sa QTest::qWaitForWindowActive(), QWindow::isExposed() */ @@ -1093,6 +1125,13 @@ This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some time after being asked to show itself on the screen. + Note that a window that is mapped to screen may still not be considered exposed if the window client + area is completely covered by other windows, or if the window is otherwise not visible. This function + will then time out when waiting for such a window. + + A specific configuration where this happens is when using QGLWidget as a viewport widget on macOS: + The viewport widget gets the expose event, not the parent widget. + \sa QTest::qWaitForWindowActive() */ |