diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2017-01-24 16:53:03 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-05-20 12:03:35 +0000 |
commit | e02213262e264bb6fcfeed9c3a38198663a04bd2 (patch) | |
tree | b5afbacc7c3c59201794eb9c800ff07a2ca32246 | |
parent | 36c167db5b11523f1adc7a61d135faaa3f8243a6 (diff) | |
download | qt-creator-e02213262e264bb6fcfeed9c3a38198663a04bd2.tar.gz |
QmlDesigner: Testproject for meta info hints
Change-Id: I610f6180fb8b26d0bc84cd291781da2f06179b7a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
10 files changed, 414 insertions, 0 deletions
diff --git a/tests/manual/qml/testprojects/metainfohints/MainForm.ui.qml b/tests/manual/qml/testprojects/metainfohints/MainForm.ui.qml new file mode 100644 index 0000000000..be32b09535 --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/MainForm.ui.qml @@ -0,0 +1,65 @@ +import QtQuick 2.8 +import QtQuick.Controls 2.1 +import QtQuick.Layouts 1.3 +import Qt.labs.calendar 1.0 +import test 1.0 + +Item { + property alias mouseArea: mouseArea + property alias textEdit: textEdit + + width: 360 + height: 360 + TestComponent { + } + + ForceClip { + } + + Rectangle { + id: rectangle + x: 152 + y: 65 + width: 200 + height: 200 + color: "#ffffff" + + TestComponent { + id: testComponent + x: 55 + y: 35 + text: qsTr("This is text") + } + } + + Text { + id: text1 + x: 17 + y: 133 + text: qsTr("Text") + font.pixelSize: 12 + } + + TestLayout { + id: testLayout + x: 8 + y: 252 + width: 100 + height: 100 + + CheckBox { + id: checkBox + text: qsTr("Check Box") + } + + CheckBox { + id: checkBox1 + text: qsTr("Check Box") + } + + CheckBox { + id: checkBox2 + text: qsTr("Check Box") + } + } +} diff --git a/tests/manual/qml/testprojects/metainfohints/imports/test/ForceClip.qml b/tests/manual/qml/testprojects/metainfohints/imports/test/ForceClip.qml new file mode 100644 index 0000000000..6c332ae0d7 --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/imports/test/ForceClip.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 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 QtQuick.Layouts 1.3 + +Item { + Rectangle { + anchors.fill: parent + anchors.margins: -100 + } +} diff --git a/tests/manual/qml/testprojects/metainfohints/imports/test/OnlyFormEditor.qml b/tests/manual/qml/testprojects/metainfohints/imports/test/OnlyFormEditor.qml new file mode 100644 index 0000000000..65604f2c66 --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/imports/test/OnlyFormEditor.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 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 QtQuick.Layouts 1.3 + +Item { + default property alias content: layout.children + RowLayout { + id: layout + } +} diff --git a/tests/manual/qml/testprojects/metainfohints/imports/test/OnlyNavigator.qml b/tests/manual/qml/testprojects/metainfohints/imports/test/OnlyNavigator.qml new file mode 100644 index 0000000000..65604f2c66 --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/imports/test/OnlyNavigator.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 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 QtQuick.Layouts 1.3 + +Item { + default property alias content: layout.children + RowLayout { + id: layout + } +} diff --git a/tests/manual/qml/testprojects/metainfohints/imports/test/TestComponent.qml b/tests/manual/qml/testprojects/metainfohints/imports/test/TestComponent.qml new file mode 100644 index 0000000000..d18f3eb40f --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/imports/test/TestComponent.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2016 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/metainfohints/imports/test/TestLayout.qml b/tests/manual/qml/testprojects/metainfohints/imports/test/TestLayout.qml new file mode 100644 index 0000000000..56cc2437e7 --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/imports/test/TestLayout.qml @@ -0,0 +1,30 @@ +/**************************************************************************** +** +** Copyright (C) 2016 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 QtQuick.Layouts 1.3 + +Item { +} diff --git a/tests/manual/qml/testprojects/metainfohints/imports/test/designer/MyPlugin.metainfo b/tests/manual/qml/testprojects/metainfohints/imports/test/designer/MyPlugin.metainfo new file mode 100644 index 0000000000..efdec6ce6e --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/imports/test/designer/MyPlugin.metainfo @@ -0,0 +1,143 @@ +MetaInfo { + Type { + name: "test.TestComponent" + icon: ":/qtquickplugin/images/item-icon16.png" + + Hints { + canBeContainer: model.potentialChildIsSubclassOf("QtQuick.Text") + canBeReparented: model.potentialParentIsSubclassOf("QtQuick.Rectangle") + isResizable: false + isMovable: !model.currentParentIsSubclassOf("QtQuick.Rectangle"); + } + + ItemLibraryEntry { + name: "Test Component" + category: "Test Plugin" + libraryIcon: ":/qtquickplugin/images/item-icon.png" + version: "1.0" + requiredImport: "test" + + Property { + name: "text" + type: "binding" + value: "qsTr(\"This is text\")" + } + } + } + + Type { + name: "test.TestLayout" + icon: ":/qtquickplugin/images/item-icon16.png" + + Hints { + canBeContainer: true + doesLayoutChildren: true + } + + ItemLibraryEntry { + name: "Test Layout" + category: "Test Plugin" + libraryIcon: ":/qtquickplugin/images/item-icon.png" + version: "1.0" + requiredImport: "test" + + Property { + name: "width" + type: "int" + value: "100" + } + + Property { + name: "height" + type: "int" + value: "100" + } + } + } + + Type { + name: "test.OnlyNavigator" + icon: ":/qtquickplugin/images/item-icon16.png" + + Hints { + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Only Navigator" + category: "Test Plugin" + libraryIcon: ":/qtquickplugin/images/item-icon.png" + version: "1.0" + requiredImport: "test" + Property { + name: "width" + type: "int" + value: "100" + } + + Property { + name: "height" + type: "int" + value: "100" + } + } + } + + Type { + name: "test.OnlyFormEditor" + icon: ":/qtquickplugin/images/item-icon16.png" + + Hints { + canBeDroppedInNavigator: false + } + + ItemLibraryEntry { + name: "Only Form Editor" + category: "Test Plugin" + libraryIcon: ":/qtquickplugin/images/item-icon.png" + version: "1.0" + requiredImport: "test" + Property { + name: "width" + type: "int" + value: "100" + } + + Property { + name: "height" + type: "int" + value: "100" + } + } + } + + Type { + name: "test.ForceClip" + icon: ":/qtquickplugin/images/item-icon16.png" + + Hints { + forceClip: true + } + + ItemLibraryEntry { + name: "Force Clip" + category: "Test Plugin" + libraryIcon: ":/qtquickplugin/images/item-icon.png" + version: "1.0" + requiredImport: "test" + Property { + name: "width" + type: "int" + value: "100" + } + + Property { + name: "height" + type: "int" + value: "100" + } + } + } + + +} diff --git a/tests/manual/qml/testprojects/metainfohints/imports/test/qmldir b/tests/manual/qml/testprojects/metainfohints/imports/test/qmldir new file mode 100644 index 0000000000..a13b61853a --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/imports/test/qmldir @@ -0,0 +1,5 @@ +TestComponent 1.0 TestComponent.qml +TestLayout 1.0 TestLayout.qml +OnlyNavigator 1.0 OnlyNavigator.qml +OnlyFormEditor 1.0 OnlyFormEditor.qml +ForceClip 1.0 ForceClip.qml diff --git a/tests/manual/qml/testprojects/metainfohints/metainfohints.qml b/tests/manual/qml/testprojects/metainfohints/metainfohints.qml new file mode 100644 index 0000000000..ab0b7ce6ef --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/metainfohints.qml @@ -0,0 +1,13 @@ +import QtQuick 2.8 +import QtQuick.Window 2.2 + +Window { + visible: true + width: 640 + height: 480 + title: qsTr("Hello World") + + MainForm { + anchors.fill: parent + } +} diff --git a/tests/manual/qml/testprojects/metainfohints/metainfohints.qmlproject b/tests/manual/qml/testprojects/metainfohints/metainfohints.qmlproject new file mode 100644 index 0000000000..4febc7b646 --- /dev/null +++ b/tests/manual/qml/testprojects/metainfohints/metainfohints.qmlproject @@ -0,0 +1,18 @@ +import QmlProject 1.1 + +Project { + mainFile: "metainfohints.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + + importPaths: [ "imports" ] +} |