summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <[email protected]>2024-11-29 10:48:45 +0100
committerVolker Hilsheimer <[email protected]>2024-12-10 23:45:41 +0100
commitb340fb69828bdbb101c3eeb0c773f554014bba77 (patch)
tree69e7dac32929b94828d1ce32ea2dde022d33a2ee
parentbe4e3082f7803f371c6f7a61f6e7770bfd67736d (diff)
Baseline tests: disable animations in the vista style
The Vista style uses a dynamic property on each objects to control animations; respect that dynamic property on the style itself as well to make it possible to turn off animations. Do so in the baseline test framework to get rid of some flakiness when using the Windows Vista style. Change-Id: I2bad329786f38e37d99f947f121e5cd44f5741c1 Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
-rw-r--r--src/plugins/styles/modernwindows/qwindowsvistastyle.cpp3
-rw-r--r--tests/baseline/shared/qwidgetbaselinetest.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
index 4ef47c36da9..d288295fbee 100644
--- a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
@@ -204,6 +204,9 @@ void QWindowsVistaStylePrivate::cleanup(bool force)
bool QWindowsVistaStylePrivate::transitionsEnabled() const
{
+ Q_Q(const QWindowsVistaStyle);
+ if (q->property("_q_no_animation").toBool())
+ return false;
if (QApplication::desktopSettingsAware()) {
BOOL animEnabled = false;
if (SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &animEnabled, 0)) {
diff --git a/tests/baseline/shared/qwidgetbaselinetest.cpp b/tests/baseline/shared/qwidgetbaselinetest.cpp
index f0d3da9e13c..32fd3eef9b7 100644
--- a/tests/baseline/shared/qwidgetbaselinetest.cpp
+++ b/tests/baseline/shared/qwidgetbaselinetest.cpp
@@ -33,6 +33,7 @@ QWidgetBaselineTest::QWidgetBaselineTest()
#endif
// turn off animations and make the cursor flash time really long to avoid blinking
QApplication::style()->setProperty("_qt_animation_time", QTime());
+ QApplication::style()->setProperty("_q_no_animation", true);
QGuiApplication::styleHints()->setCursorFlashTime(50000);
QByteArray appearanceBytes;