diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-02-11 17:34:27 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-02-17 10:45:37 +0000 |
commit | 0d319ac3a1b558fab759ede8dc2178ccdb3502ea (patch) | |
tree | e1841398d005429c497fcddffdd7bb22021883cb /tests | |
parent | c8481710c9c9c8493d7ce0d61db8a5e1869e2540 (diff) |
QmlDesigner: Fix loading of .metainfo for versioned folders
This fixes a regression introduced by 7ea6492a17736e079ddf192b18d061076dfbf9c7.
Since we actually check if import folders exist,
we did not take versioned folders into account. e.g. 'MyPlugin.1'
Extended and cleaned up the manual test case.
Task-number: QDS-6078
Change-Id: I3235d8fe498745903c5ca897e25e3d43222c119f
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'tests')
7 files changed, 258 insertions, 6 deletions
diff --git a/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/MyComponent.qml b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/MyComponent.qml new file mode 100644 index 0000000000..e52e52d7d1 --- /dev/null +++ b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/MyComponent.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 60 + height: 60 + color: "green" + property alias text: textItem.text + + Text { + id: textItem + anchors.centerIn: parent + } +} diff --git a/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/MyComponent2.qml b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/MyComponent2.qml new file mode 100644 index 0000000000..5e2306a716 --- /dev/null +++ b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/MyComponent2.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + property alias text: textItem.text + property alias color: rect.color + property alias radius: rect.radius + + Rectangle { + id: rect + anchors.fill: parent + color: "green" + + Text { + id: textItem + anchors.centerIn: parent + } + } +} diff --git a/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/designer/MyComponentSpecifics.qml b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/designer/MyComponentSpecifics.qml new file mode 100644 index 0000000000..c6c888e369 --- /dev/null +++ b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/designer/MyComponentSpecifics.qml @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.0 +import HelperWidgets 2.0 +import QtQuick.Layouts 1.0 + +Column { + anchors.left: parent.left + anchors.right: parent.right + + Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Color") + + ColorEditor { + caption: qsTr("Color") + backendValue: backendValues.color + supportGradient: true + } + + + } + + Section { + anchors.left: parent.left + anchors.right: parent.right + caption: "Rectangle" + + SectionLayout { + rows: 2 + + Label { + text: qsTr("Text") + } + + SecondColumnLayout { + LineEdit { + backendValue: backendValues.text + Layout.fillWidth: true + } + } + + Label { + text: qsTr("Radius") + } + SecondColumnLayout { + SpinBox { + backendValue: backendValues.radius + hasSlider: true + Layout.preferredWidth: 80 + minimumValue: 0 + maximumValue: Math.min(backendValues.height.value, backendValues.width.value) / 2 + } + ExpandingSpacer { + + } + } + } + } +} diff --git a/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/designer/MyPlugin.metainfo b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/designer/MyPlugin.metainfo new file mode 100644 index 0000000000..5eef250228 --- /dev/null +++ b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/designer/MyPlugin.metainfo @@ -0,0 +1,44 @@ +MetaInfo { + Type { + name: "MyPlugin2.MyComponent" + icon: ":/qtquickplugin/images/item-icon16.png" + + ItemLibraryEntry { + name: "My Component" + category: "My Test Plugin 2" + libraryIcon: ":/qtquickplugin/images/item-icon.png" + version: "1.0" + requiredImport: "MyPlugin2" + + Property { + name: "text" + type: "binding" + value: "qsTr(\"This is text\")" + } + } + } + + Type { + name: "MyPlugin2.MyComponent2" + icon: ":/qtquickplugin/images/item-icon16.png" + + ItemLibraryEntry { + name: "My Component 2" + category: "My Test Plugin 2" + libraryIcon: ":/qtquickplugin/images/item-icon.png" + version: "1.0" + requiredImport: "MyPlugin2" + + Property { + name: "text" + type: "binding" + value: "qsTr(\"This is text\")" + } + + Property { name: "width"; type: "int"; value: 200; } + Property { name: "height"; type: "int"; value: 200; } + Property { name: "color"; type: "QColor"; value: "red"; } + } + } + +} diff --git a/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/qmldir b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/qmldir new file mode 100644 index 0000000000..660f6d416b --- /dev/null +++ b/tests/manual/qml/testprojects/plugins/imports/MyPlugin2.1/qmldir @@ -0,0 +1,2 @@ +MyComponent 1.0 MyComponent.qml +MyComponent2 1.0 MyComponent2.qml diff --git a/tests/manual/qml/testprojects/plugins/plugins.qml b/tests/manual/qml/testprojects/plugins/plugins.qml index dc3d729077..daf85ad389 100644 --- a/tests/manual/qml/testprojects/plugins/plugins.qml +++ b/tests/manual/qml/testprojects/plugins/plugins.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,13 +23,10 @@ ** ****************************************************************************/ -import QtQuick 2.3 -import QtQuick.Controls 1.2 -import QtQuick.Window 2.2 +import QtQuick import MyPlugin 1.0 -ApplicationWindow { - title: qsTr("Hello World") +Rectangle { width: 640 height: 480 @@ -38,3 +35,9 @@ ApplicationWindow { } } + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ diff --git a/tests/manual/qml/testprojects/plugins/plugins2.qml b/tests/manual/qml/testprojects/plugins/plugins2.qml new file mode 100644 index 0000000000..9e586d56f8 --- /dev/null +++ b/tests/manual/qml/testprojects/plugins/plugins2.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.3 +import MyPlugin2 1.0 + +Rectangle { + + width: 640 + height: 480 + + MyComponent { + text: qsTr("Some Text") + + } +} |