aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qquickstyle/tst_qquickstyle.cpp1
-rw-r--r--tests/auto/shared/qtest_quickcontrols.h6
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/qquickstyle/tst_qquickstyle.cpp b/tests/auto/qquickstyle/tst_qquickstyle.cpp
index b9497500..97259051 100644
--- a/tests/auto/qquickstyle/tst_qquickstyle.cpp
+++ b/tests/auto/qquickstyle/tst_qquickstyle.cpp
@@ -137,6 +137,7 @@ void tst_QQuickStyle::configurationFile()
QVERIFY2(!object.isNull(), qPrintable(labelComponent.errorString()));
QCOMPARE(QQuickStyle::name(), expectedStyle);
+ QVERIFY(!QQuickStylePrivate::isUsingDefaultStyle());
// Test that fonts and palettes specified in configuration files are respected.
QQuickLabel *label = qobject_cast<QQuickLabel *>(object.data());
diff --git a/tests/auto/shared/qtest_quickcontrols.h b/tests/auto/shared/qtest_quickcontrols.h
index acd0304c..8eadd979 100644
--- a/tests/auto/shared/qtest_quickcontrols.h
+++ b/tests/auto/shared/qtest_quickcontrols.h
@@ -46,7 +46,11 @@
static QStringList testStyles()
{
- if (QQuickStyle::name().isEmpty())
+ // It's not enough to check if the name is empty, because since Qt 6
+ // we set an appropriate style for the platform if no style was specified.
+ // Also, we need the name check to come first, as isUsingDefaultStyle() does not do any resolving,
+ // and so its return value wouldn't be correct otherwise.
+ if (QQuickStyle::name().isEmpty() || QQuickStylePrivate::isUsingDefaultStyle())
return QQuickStylePrivate::builtInStyles();
return QStringList(QQuickStyle::name());
}