aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-01-29 17:05:19 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-01 14:01:25 +0100
commit4e36c03112e62f3d65391b21c5574cae1a0050c6 (patch)
tree3d89d7231bf5b0dc1ff83193b122c86c836fd14a /src/qmltest
parent3e7d1a990d39132e12a82601afe1db019c258e66 (diff)
Drop widgets dependency from quicktest
It was introduced for QtQuick.Controls 1 back when it was still called QtDesktopComponents. QtQuick.Controls 1 is deprecated and also doesn't use the widgets mode anymore. I can't think of any other use for it, but loading QtWidgets produces a number of unwelcome side effects in the tests. Change-Id: I4b7e53a9b906c428d84926302bf629b826d900c4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/CMakeLists.txt7
-rw-r--r--src/qmltest/quicktest.cpp32
2 files changed, 2 insertions, 37 deletions
diff --git a/src/qmltest/CMakeLists.txt b/src/qmltest/CMakeLists.txt
index dd8139af9d..0e9d5c73f6 100644
--- a/src/qmltest/CMakeLists.txt
+++ b/src/qmltest/CMakeLists.txt
@@ -43,13 +43,6 @@ qt_internal_add_module(QuickTest
## Scopes:
#####################################################################
-qt_internal_extend_target(QuickTest CONDITION TARGET Qt::Widgets
- DEFINES
- QT_QMLTEST_WITH_WIDGETS
- PUBLIC_LIBRARIES
- Qt::Widgets
-)
-
qt_internal_extend_target(QuickTest CONDITION QT_FEATURE_qml_debug
DEFINES
QT_QML_DEBUG_NO_WARNING
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 9085f96337..78937766cb 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -72,10 +72,6 @@
#include <private/qqmlcomponent_p.h>
#include <private/qv4resolvedtypereference_p.h>
-#ifdef QT_QMLTEST_WITH_WIDGETS
-#include <QtWidgets/QApplication>
-#endif
-
QT_BEGIN_NAMESPACE
/*!
@@ -362,28 +358,9 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
int quick_test_main_with_setup(int argc, char **argv, const char *name, const char *sourceDir, QObject *setup)
{
- // Peek at arguments to check for '-widgets' argument
-#ifdef QT_QMLTEST_WITH_WIDGETS
- bool withWidgets = false;
- for (int index = 1; index < argc; ++index) {
- if (strcmp(argv[index], "-widgets") == 0) {
- withWidgets = true;
- break;
- }
- }
-#endif
-
QCoreApplication *app = nullptr;
- if (!QCoreApplication::instance()) {
-#ifdef QT_QMLTEST_WITH_WIDGETS
- if (withWidgets)
- app = new QApplication(argc, argv);
- else
-#endif
- {
- app = new QGuiApplication(argc, argv);
- }
- }
+ if (!QCoreApplication::instance())
+ app = new QGuiApplication(argc, argv);
if (setup)
maybeInvokeSetupMethod(setup, "applicationAvailable()");
@@ -415,11 +392,6 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch
index += 2;
} else if (strcmp(argv[index], "-opengl") == 0) {
++index;
-#ifdef QT_QMLTEST_WITH_WIDGETS
- } else if (strcmp(argv[index], "-widgets") == 0) {
- withWidgets = true;
- ++index;
-#endif
} else if (strcmp(argv[index], "-translation") == 0 && (index + 1) < argc) {
translationFile = stripQuotes(QString::fromLocal8Bit(argv[index + 1]));
index += 2;