From 9aafea810b8867fb31f9ec27a238628467e7ab56 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 1 Apr 2020 15:37:07 +0200 Subject: Move Default style out into its own plugin In upcoming patches, we start registering C++ types declaratively. A condition of doing so requires that each .pro corresponds to one QML module. This conflicts with the QtQuick.Controls import, which currently does quite a lot: - Registers (and selects) QML files for the style that was set - Registers private C++ utility types (such as IconLabel) that are useful for all styles under the QtQuick.Controls.impl import - Registers private C++ types that are only useful for the Default style (such as BusyIndicatorImpl). The reason it does so much can probably be explained by the intended usage of Qt Quick Controls 2; when you do import QtQuick.Controls 2.0 you get access to the QML types (e.g. Button) that the style you're using provides. So if you're using the Material style, you'll get a Material style button. API-wise, the button is identical to any other button, because the types in QtQuick.Templates are what we advertise as the public API. If we didn't have this functionality, users would need to import specific style imports to use controls, and the convenience of being able to simply start the application with a different style by e.g. passing an application argument would be lost. To support declarative registration of types while also supporting the existing use cases, we split out the Default-style-specific stuff into a QtQuick.Controls.Default import. Task-number: QTBUG-82922 Change-Id: Ib4f1620cae78d7acdc13d9ac0752a020bc22f3ea Reviewed-by: Ulf Hermann --- tests/auto/controls/data/tst_switchdelegate.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/controls/data/tst_switchdelegate.qml') diff --git a/tests/auto/controls/data/tst_switchdelegate.qml b/tests/auto/controls/data/tst_switchdelegate.qml index 1c96023f..3bdfc83d 100644 --- a/tests/auto/controls/data/tst_switchdelegate.qml +++ b/tests/auto/controls/data/tst_switchdelegate.qml @@ -560,11 +560,11 @@ TestCase { text: "SwitchDelegate", display: data.display, width: 400, - "icon.source": "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png", + "icon.source": "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png", "LayoutMirroring.enabled": !!data.mirrored }) verify(control) - compare(control.icon.source, "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png") + compare(control.icon.source, "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png") var iconImage = findChild(control.contentItem, "image") var textLabel = findChild(control.contentItem, "label") -- cgit v1.2.3 From 44847322109bd237498f3f74c4784bf27757a810 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 26 Mar 2020 16:07:16 +0100 Subject: Remove ".2" from TARGETPATH, resource prefixes, etc. Qt Quick Controls 1 will be removed in Qt 6, so now we can have the simplified path for ourselves. Having the .2 in the path causes issues for importing now that the version is being bumped to 6. Task-number: QTBUG-82922 Change-Id: I0b92cdd44c42c19b1c82e7b9a7959b86ac26c6e2 Reviewed-by: Ulf Hermann --- tests/auto/controls/data/tst_switchdelegate.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/controls/data/tst_switchdelegate.qml') diff --git a/tests/auto/controls/data/tst_switchdelegate.qml b/tests/auto/controls/data/tst_switchdelegate.qml index 3bdfc83d..890c89b8 100644 --- a/tests/auto/controls/data/tst_switchdelegate.qml +++ b/tests/auto/controls/data/tst_switchdelegate.qml @@ -560,11 +560,11 @@ TestCase { text: "SwitchDelegate", display: data.display, width: 400, - "icon.source": "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png", + "icon.source": "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png", "LayoutMirroring.enabled": !!data.mirrored }) verify(control) - compare(control.icon.source, "qrc:/qt-project.org/imports/QtQuick/Controls.2/Default/images/check.png") + compare(control.icon.source, "qrc:/qt-project.org/imports/QtQuick/Controls/Default/images/check.png") var iconImage = findChild(control.contentItem, "image") var textLabel = findChild(control.contentItem, "label") -- cgit v1.2.3 From d451cab0c8b727fa7f12a169a3d6ee449a3a1902 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 26 Mar 2020 17:01:51 +0100 Subject: Remove all version numbers from QML imports As of Qt 6, the latest version will be used by default. This saves us a lot of effort in terms of version bumps. Task-number: QTBUG-82922 Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928 Reviewed-by: Fabian Kosmale --- tests/auto/controls/data/tst_switchdelegate.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto/controls/data/tst_switchdelegate.qml') diff --git a/tests/auto/controls/data/tst_switchdelegate.qml b/tests/auto/controls/data/tst_switchdelegate.qml index 890c89b8..4cf90bb6 100644 --- a/tests/auto/controls/data/tst_switchdelegate.qml +++ b/tests/auto/controls/data/tst_switchdelegate.qml @@ -48,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtTest 1.0 -import QtQuick.Controls 2.12 +import QtQuick +import QtTest +import QtQuick.Controls TestCase { id: testCase -- cgit v1.2.3