diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-03-23 15:40:04 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-05-05 16:50:31 +0200 |
commit | dc96d812ec0c2a007fdaf2659b73dd6ed8b61dfe (patch) | |
tree | 3482267868625a821493ab83284281a1a3ff2908 /tests/baseline | |
parent | 664b84c1372d933adecdb4196059675684922111 (diff) | |
download | qtbase-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.cpp | 3 |
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(); } |