Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Variables | |
static const int | defaultTimeout = 5000 |
static Qt::MouseButton | pressedTabletButton = Qt::NoButton |
static Qt::KeyboardModifiers | pressedTabletModifiers = Qt::NoModifier |
|
nodiscard |
Initialize view, set url, center in available geometry, move mouse away if desired. If errorMessage is given, QQuickView::errors() will be concatenated into it; otherwise, the QWARN messages are generally enough to debug the test.
Returns false
if the view fails to load the QML. That should be fatal in most tests, so normally the return value should be checked with QVERIFY.
Definition at line 443 of file viewtestutils.cpp.
void QQuickTest::pointerFlick | ( | const QPointingDevice * | dev, |
QQuickWindow * | window, | ||
int | pointId, | ||
const QPoint & | from, | ||
const QPoint & | to, | ||
int | duration, | ||
Qt::MouseButton | button = Qt::LeftButton, | ||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier, | ||
int | delay = -1 ) |
Definition at line 623 of file viewtestutils.cpp.
void QQuickTest::pointerMove | ( | const QPointingDevice * | dev, |
QQuickWindow * | window, | ||
int | pointId, | ||
const QPoint & | p, | ||
int | delay = -1 ) |
Definition at line 545 of file viewtestutils.cpp.
References QQuickTouchUtils::flush().
void QQuickTest::pointerMoveAndPress | ( | const QPointingDevice * | dev, |
QQuickWindow * | window, | ||
int | pointId, | ||
const QPoint & | p, | ||
Qt::MouseButton | button = Qt::LeftButton, | ||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier, | ||
int | delay = -1 ) |
Definition at line 607 of file viewtestutils.cpp.
void QQuickTest::pointerMoveAndRelease | ( | const QPointingDevice * | dev, |
QQuickWindow * | window, | ||
int | pointId, | ||
const QPoint & | p, | ||
Qt::MouseButton | button = Qt::LeftButton, | ||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier, | ||
int | delay = -1 ) |
Definition at line 615 of file viewtestutils.cpp.
void QQuickTest::pointerPress | ( | const QPointingDevice * | dev, |
QQuickWindow * | window, | ||
int | pointId, | ||
const QPoint & | p, | ||
Qt::MouseButton | button = Qt::LeftButton, | ||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier, | ||
int | delay = -1 ) |
Definition at line 513 of file viewtestutils.cpp.
References QQuickTouchUtils::flush(), pressedTabletButton, and pressedTabletModifiers.
void QQuickTest::pointerRelease | ( | const QPointingDevice * | dev, |
QQuickWindow * | window, | ||
int | pointId, | ||
const QPoint & | p, | ||
Qt::MouseButton | button = Qt::LeftButton, | ||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier, | ||
int | delay = -1 ) |
Definition at line 577 of file viewtestutils.cpp.
References QQuickTouchUtils::flush().
QT_BEGIN_NAMESPACE bool QQuickTest::qIsPolishScheduled | ( | const QQuickItem * | item | ) |
Returns true
if \l {QQuickItem::}{updatePolish()} has not been called on item since the last call to \l {QQuickItem::}{polish()}, otherwise returns false
.
When assigning values to properties in QML, any layouting the item must do as a result of the assignment might not take effect immediately, but can instead be postponed until the item is polished. For these cases, you can use this function to ensure that the item has been polished before the execution of the test continues. For example:
Without the call to qIsPolishScheduled()
above, the call to qWaitForItemPolished()
might see that no polish was scheduled and therefore pass instantly, assuming that the item had already been polished. This function makes it obvious why an item wasn't polished and allows tests to fail early under such circumstances.
The QML equivalent of this function is \l {TestCase::}{isPolishScheduled()}.
Definition at line 80 of file quicktest.cpp.
bool QQuickTest::qIsPolishScheduled | ( | const QQuickWindow * | window | ) |
Definition at line 108 of file quicktest.cpp.
bool QQuickTest::qWaitForPolish | ( | const QQuickItem * | item, |
int | timeout = defaultTimeout ) |
Waits for timeout milliseconds or until \l {QQuickItem::}{updatePolish()} has been called on item.
Returns true
if updatePolish()
was called on item within timeout milliseconds, otherwise returns false
.
Definition at line 150 of file quicktest.cpp.
bool QQuickTest::qWaitForPolish | ( | const QQuickWindow * | window, |
int | timeout = defaultTimeout ) |
Waits for timeout milliseconds or until qIsPolishScheduled(item)
returns false
for all items managed by window.
Returns true
if qIsPolishScheduled(item)
returns false for all items within timeout milliseconds, otherwise returns false
.
The QML equivalent of this function is \l [QML]{TestCase::}{waitForPolish()}.
Definition at line 170 of file quicktest.cpp.
|
nodiscard |
Initialize view, set url, center in available geometry, move mouse away, show the view, wait for it to be exposed, and verify that its rootObject is not null.
Returns false
if anything fails, which should be fatal in most tests. The usual way to call this function is
Definition at line 486 of file viewtestutils.cpp.
|
static |
Definition at line 69 of file quicktest.h.
|
static |
Definition at line 510 of file viewtestutils.cpp.
Referenced by pointerPress().
|
static |
Definition at line 511 of file viewtestutils.cpp.
Referenced by pointerPress().