aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest/qmltest.pro
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-10-19 15:24:58 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-10-31 08:53:58 +0000
commit40d6072bc8a4df0fe1a16025fe30fe653463a446 (patch)
tree73af16915b9c7b66963f764d3f3c2f5eb681b089 /src/qmltest/qmltest.pro
parentb26da0a8cdf3b342e42055f16190867aabf7aaf0 (diff)
Add QQuickTest::qIsPolishScheduled()
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 in visualtestutil.h (line 103). - "git grep polishScheduled -- tests/auto | wc -l" says that there are 269 usages of polishScheduled in Qt Quick auto tests, almost all of which look like this: QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false); - QQuickTableView's auto tests have their own function: #define WAIT_UNTIL_POLISHED \ QVERIFY(tableViewPrivate->polishScheduled); \ QTRY_VERIFY(!tableViewPrivate->polishScheduled) - More recently, QQuickMenu started requiring it (see menuutil.h). QQuickItem::polish() and QQuickItem::updatePolish() are both public functions, so the notion of polishing in Qt Quick is not new or hidden. This means that any user applications that have custom items that make use of the polish() => updatePolish() system will benefit from having a reliable method of testing their behavior. In addition, anyone wanting to simulate interaction with items in e.g. QQuickMenu will need this API if they don't want to use unreliable qWait() calls. With this in mind, this and the follow-up patch aim to standardise/ simplify the various private API checks and utility functions, and provide public API for users so that they can benefit from more reliable tests. When used together, the code will look like this: QVERIFY(QQuickTest::qIsPolishScheduled(item)); QVERIFY(QQuickTest::qWaitForItemPolished(item)); The follow up patch adds auto tests. [ChangeLog][QtQuickTest][QQuickTest] Added qIsPolishScheduled() function to allow checking if updatePolish() has been called on an item since the last call to its polish() function. This is useful to verify that a polish has been scheduled. Task-number: QTBUG-71224 Change-Id: I856a40321945c0070e4679e11e4812e0d7adc1f9 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/qmltest/qmltest.pro')
-rw-r--r--src/qmltest/qmltest.pro2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro
index e2200e5abb..0bf05093be 100644
--- a/src/qmltest/qmltest.pro
+++ b/src/qmltest/qmltest.pro
@@ -4,7 +4,7 @@ QMAKE_DOCS = $$PWD/doc/qtqmltest.qdocconf
DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_FOREACH
QT = core testlib-private
-QT_PRIVATE = quick qml-private gui core-private gui-private
+QT_PRIVATE = quick quick-private qml-private gui core-private gui-private
# Testlib is only a private dependency, which results in our users not
# inheriting testlibs's MODULE_CONFIG transitively. Make it explicit.