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
|
// Encode a number of parameters that impact the UI
|
||||||
QPalette palette;
|
QPalette palette;
|
||||||
QFont font;
|
QFont font;
|
||||||
QByteArray appearanceBytes;
|
const QString styleName =
|
||||||
{
|
|
||||||
QDataStream appearanceStream(&appearanceBytes, QIODevice::WriteOnly);
|
|
||||||
appearanceStream << palette << font <<
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
QApplication::style()->metaObject()->className();
|
QApplication::style()->metaObject()->className();
|
||||||
#else
|
#else
|
||||||
QApplication::style()->name();
|
QApplication::style()->name();
|
||||||
#endif
|
#endif
|
||||||
|
QByteArray appearanceBytes;
|
||||||
|
{
|
||||||
|
QDataStream appearanceStream(&appearanceBytes, QIODevice::WriteOnly);
|
||||||
|
appearanceStream << palette << font;
|
||||||
const qreal screenDpr = QApplication::primaryScreen()->devicePixelRatio();
|
const qreal screenDpr = QApplication::primaryScreen()->devicePixelRatio();
|
||||||
if (screenDpr != 1.0)
|
if (screenDpr != 1.0)
|
||||||
qWarning() << "DPR is" << screenDpr << "- images will be scaled";
|
qWarning() << "DPR is" << screenDpr << "- images will be scaled";
|
||||||
@ -72,8 +73,8 @@ QWidgetBaselineTest::QWidgetBaselineTest()
|
|||||||
const QColor windowColor = palette.window().color();
|
const QColor windowColor = palette.window().color();
|
||||||
const QColor textColor = palette.text().color();
|
const QColor textColor = palette.text().color();
|
||||||
const QString appearanceIdString = (windowColor.value() > textColor.value()
|
const QString appearanceIdString = (windowColor.value() > textColor.value()
|
||||||
? QString("light-%1") : QString("dark-%1"))
|
? QString("light-%1-%2") : QString("dark-%1-%2"))
|
||||||
.arg(appearanceId, 0, 16);
|
.arg(styleName).arg(appearanceId, 0, 16);
|
||||||
QBaselineTest::addClientProperty("AppearanceID", appearanceIdString);
|
QBaselineTest::addClientProperty("AppearanceID", appearanceIdString);
|
||||||
|
|
||||||
// let users know where they can find the results
|
// let users know where they can find the results
|
||||||
|
Loading…
x
Reference in New Issue
Block a user