From 4e36c03112e62f3d65391b21c5574cae1a0050c6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 29 Jan 2021 17:05:19 +0100 Subject: 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 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Fabian Kosmale --- src/qmltest/CMakeLists.txt | 7 ------- src/qmltest/quicktest.cpp | 32 ++------------------------------ 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 #include -#ifdef QT_QMLTEST_WITH_WIDGETS -#include -#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; -- cgit v1.2.3