aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickapplicationwindow
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-09-30 14:22:42 +0200
committerMitch Curtis <mitch.curtis@qt.io>2020-10-07 13:31:20 +0200
commit81e8cd67198768a08f5c65ec026e1553f78e1375 (patch)
treedccf23caaf08f06e3436e43993be8fa74093a1d0 /tests/auto/qquickapplicationwindow
parent8b534487044dfb3b464431ecb91ef4e0864af4ed (diff)
Make tests explicitly use Basic where necessary
The previous commit changes the how the default style is set, and since the tests all assumed that Basic was the default, we now need to ensure it is explicitly set. If we want to, we can revert this patch (or file-by-file) later and ensure that these tests work with all styles. For now, just keep things working as they used to. Tests that use QTEST_QUICKCONTROLS_MAIN are not changed, as they already run with all built-in styles. Tests that don't use types that will cause issues, like tst_qquickcolor, do not need to be changed. tst_snippets can be run manually to produce screenshots, so we specify its style in a qtquickcontrols2.conf file to allow it to be overridden by e.g. application arguments (QQuickStyle::setStyle() takes precedence over all other approaches of setting a style). Change-Id: Ifae7e959f89a41a757c170272038fad139bba04f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/qquickapplicationwindow')
-rw-r--r--tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp b/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
index c57cf92e..b2535ccb 100644
--- a/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
+++ b/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
@@ -60,7 +60,9 @@ using namespace QQuickVisualTestUtil;
class tst_QQuickApplicationWindow : public QQmlDataTest
{
Q_OBJECT
+
public:
+ tst_QQuickApplicationWindow();
private slots:
void qmlCreation();
@@ -81,6 +83,11 @@ private slots:
void opacity();
};
+tst_QQuickApplicationWindow::tst_QQuickApplicationWindow()
+{
+ QQuickStyle::setStyle("Basic");
+}
+
void tst_QQuickApplicationWindow::qmlCreation()
{
QQmlEngine engine;