diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-29 17:05:19 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-01 14:01:25 +0100 |
commit | 4e36c03112e62f3d65391b21c5574cae1a0050c6 (patch) | |
tree | 3d89d7231bf5b0dc1ff83193b122c86c836fd14a /src/qmltest/quicktest.cpp | |
parent | 3e7d1a990d39132e12a82601afe1db019c258e66 (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/quicktest.cpp')
-rw-r--r-- | src/qmltest/quicktest.cpp | 32 |
1 files changed, 2 insertions, 30 deletions
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; |