Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
None
-
None
-
7a3cad0619662b992154e075ec6b840bfc8a46a7 (qt/qtdeclarative/dev)
Description
Verifying that an item was polished is quite common in Qt's auto tests:
- The Qt Quick auto tests have a util function for it: http://code.qt.io/cgit/qt/qtdeclarative.git/tree/tests/auto/quick/shared/visualtestutil.h#n103
- git grep polishScheduled – tests/auto | wc -l says that there are 269 usages of polishScheduled in Qt Quick auto tests.
- QQuickTableView's auto tests have their own function: http://code.qt.io/cgit/qt/qtdeclarative.git/tree/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp?h=5.12#n81
- More recently, QQuickMenu started requiring it: https://codereview.qt-project.org/#/c/225747/23/tests/auto/shared/menuutil.h
Any user applications that simulate user interaction will also need this API if they don't want to use unreliable qWait() calls.
QQuickItem::polish() and QQuickItem::updatePolish() are both public functions, so the notion of polishing in Qt Quick is not new or hidden.
I propose adding some functions that can be used to ensure that an item has been polished (and in my case, is ready for mouse events). Then, client code could look something like this:
item->polish(); // May not be necessary...
QVERIFY(QQuickTest::qIsPolishScheduled(item));
QVERIFY(QQuickTest::qWaitForItemPolished(item));
Attachments
Issue Links
- resulted in
-
QTBUG-93757 Add API to QQuickTest that checks if windows have any items to be polished
-
- Closed
-