QmlDesigner: Testproject for meta info hints

Change-Id: I610f6180fb8b26d0bc84cd291781da2f06179b7a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2017-01-24 16:53:03 +01:00
parent 36c167db5b
commit e02213262e
10 changed files with 414 additions and 0 deletions

View File

@@ -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")
}
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

@@ -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 {
}

View File

@@ -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"
}
}
}
}

View File

@@ -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

View File

@@ -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
}
}

View File

@@ -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" ]
}