summaryrefslogtreecommitdiff
path: root/tests/baseline
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-03-23 15:40:04 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-05-05 16:50:31 +0200
commitdc96d812ec0c2a007fdaf2659b73dd6ed8b61dfe (patch)
tree3482267868625a821493ab83284281a1a3ff2908 /tests/baseline
parent664b84c1372d933adecdb4196059675684922111 (diff)
downloadqtbase-dc96d812ec0c2a007fdaf2659b73dd6ed8b61dfe.tar.gz
Baseline testing of widget: wait before taking snapshot
Widgets and styles might use fade effects or other asynchronous mechanisms as part of hovering. This results in mismatches when the snapshot is taken before those effects are completed. Since we can't control all such animations from the outside, process events for some milliseconds before taking the snapshot. Pick-to: 6.3 Change-Id: I771658300628238552bddcd14a6751c3f6c0c63d Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/baseline')
-rw-r--r--tests/baseline/shared/qwidgetbaselinetest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/baseline/shared/qwidgetbaselinetest.cpp b/tests/baseline/shared/qwidgetbaselinetest.cpp
index 3be8ae7893..b5db9a23f1 100644
--- a/tests/baseline/shared/qwidgetbaselinetest.cpp
+++ b/tests/baseline/shared/qwidgetbaselinetest.cpp
@@ -131,7 +131,8 @@ void QWidgetBaselineTest::makeVisible()
*/
QImage QWidgetBaselineTest::takeSnapshot()
{
- QGuiApplication::processEvents();
+ // make sure all effects are done
+ QTest::qWait(250);
return window->grab().toImage();
}