Baseline tests: slow down cursor blinking

Override the default cursor blink time so that we don't get mismatches
from line edits. We need to set the time to > 0 so that QStyleHints does
not fall back to the platform integration.

Pick-to: 6.3
Change-Id: Ib1d04f7450c01c352c13098886aee032dcb14c72
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Volker Hilsheimer 2022-03-30 13:51:43 +02:00
parent dc96d812ec
commit 4222d117d2

View File

@ -31,6 +31,7 @@
#include <qbaselinetest.h>
#include <QApplication>
#include <QStyle>
#include <QStyleHints>
#include <QScreen>
QT_BEGIN_NAMESPACE
@ -53,7 +54,10 @@ QWidgetBaselineTest::QWidgetBaselineTest()
#else
QApplication::style()->name();
#endif
// turn off animations and make the cursor flash time really long to avoid blinking
QApplication::style()->setProperty("_qt_animation_time", QTime());
QGuiApplication::styleHints()->setCursorFlashTime(50000);
QByteArray appearanceBytes;
{
QDataStream appearanceStream(&appearanceBytes, QIODevice::WriteOnly);