Baseline testing: make style name explicit
Mangling it into the checksum makes it hard to navigate the available images. Pick-to: 6.3 Change-Id: I54dcab5681e747ce1c5fe1b141ef6c4441d1f7eb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
d1e02c3855
commit
ad333b9b87
@ -47,15 +47,16 @@ QWidgetBaselineTest::QWidgetBaselineTest()
|
||||
// Encode a number of parameters that impact the UI
|
||||
QPalette palette;
|
||||
QFont font;
|
||||
QByteArray appearanceBytes;
|
||||
{
|
||||
QDataStream appearanceStream(&appearanceBytes, QIODevice::WriteOnly);
|
||||
appearanceStream << palette << font <<
|
||||
const QString styleName =
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QApplication::style()->metaObject()->className();
|
||||
#else
|
||||
QApplication::style()->name();
|
||||
#endif
|
||||
QByteArray appearanceBytes;
|
||||
{
|
||||
QDataStream appearanceStream(&appearanceBytes, QIODevice::WriteOnly);
|
||||
appearanceStream << palette << font;
|
||||
const qreal screenDpr = QApplication::primaryScreen()->devicePixelRatio();
|
||||
if (screenDpr != 1.0)
|
||||
qWarning() << "DPR is" << screenDpr << "- images will be scaled";
|
||||
@ -72,8 +73,8 @@ QWidgetBaselineTest::QWidgetBaselineTest()
|
||||
const QColor windowColor = palette.window().color();
|
||||
const QColor textColor = palette.text().color();
|
||||
const QString appearanceIdString = (windowColor.value() > textColor.value()
|
||||
? QString("light-%1") : QString("dark-%1"))
|
||||
.arg(appearanceId, 0, 16);
|
||||
? QString("light-%1-%2") : QString("dark-%1-%2"))
|
||||
.arg(styleName).arg(appearanceId, 0, 16);
|
||||
QBaselineTest::addClientProperty("AppearanceID", appearanceIdString);
|
||||
|
||||
// let users know where they can find the results
|
||||
|
Loading…
x
Reference in New Issue
Block a user