diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-10-14 16:57:03 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-10-14 17:18:48 +0200 |
commit | d7105cc24513913b73d8d4b82500fe5e6f231f09 (patch) | |
tree | d52da14189e47561848d9a06bc3d73a5f2270b81 /share/qtcreator/templates | |
parent | cf0f2e464f3db3dc944316be5669fc661f2ef252 (diff) | |
download | qt-creator-d7105cc24513913b73d8d4b82500fe5e6f231f09.tar.gz |
Wizard for ui.qml file based project.
Change-Id: Id0f61efce0ae47c28eb2f5fbcee5468dc5c339ca
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'share/qtcreator/templates')
-rw-r--r-- | share/qtcreator/templates/qml/qtquick_2_4/MainForm.ui.qml | 31 | ||||
-rw-r--r-- | share/qtcreator/templates/qml/qtquick_2_4/main.qml | 45 | ||||
-rw-r--r-- | share/qtcreator/templates/qml/qtquick_2_4/template.xml | 8 |
3 files changed, 69 insertions, 15 deletions
diff --git a/share/qtcreator/templates/qml/qtquick_2_4/MainForm.ui.qml b/share/qtcreator/templates/qml/qtquick_2_4/MainForm.ui.qml new file mode 100644 index 0000000000..e557debb83 --- /dev/null +++ b/share/qtcreator/templates/qml/qtquick_2_4/MainForm.ui.qml @@ -0,0 +1,31 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +Item { + width: 640 + height: 480 + + property alias button3: button3 + property alias button2: button2 + property alias button1: button1 + + RowLayout { + anchors.centerIn: parent + + Button { + id: button1 + text: qsTr("Press Me 1") + } + + Button { + id: button2 + text: qsTr("Press Me 2") + } + + Button { + id: button3 + text: qsTr("Press Me 3") + } + } +} diff --git a/share/qtcreator/templates/qml/qtquick_2_4/main.qml b/share/qtcreator/templates/qml/qtquick_2_4/main.qml index f23e94cfc0..3854fd8585 100644 --- a/share/qtcreator/templates/qml/qtquick_2_4/main.qml +++ b/share/qtcreator/templates/qml/qtquick_2_4/main.qml @@ -1,19 +1,42 @@ import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Window 2.2 +import QtQuick.Dialogs 1.2 -Rectangle { - width: 360 - height: 360 +ApplicationWindow { + title: qsTr("Hello World") + width: 640 + height: 480 - MouseArea { - anchors.fill: parent - onClicked: { - Qt.quit(); + menuBar: MenuBar { + Menu { + title: qsTr("&File") + MenuItem { + text: qsTr("&Open") + onTriggered: messageDialog.show(qsTr("Open action triggered")) + } + MenuItem { + text: qsTr("E&xit") + onTriggered: Qt.quit(); + } } } - Text { - anchors.centerIn: parent - text: "Hello World" + MainForm { + anchors.fill: parent + button1.onClicked: messageDialog.show(qsTr("Button 1 pressed")) + button2.onClicked: messageDialog.show(qsTr("Button 2 pressed")) + button3.onClicked: messageDialog.show(qsTr("Button 3 pressed")) } -} + MessageDialog { + id: messageDialog + title: qsTr("May I have your attention please") + + function show(caption) { + messageDialog.text = caption; + messageDialog.open(); + } + + } +} diff --git a/share/qtcreator/templates/qml/qtquick_2_4/template.xml b/share/qtcreator/templates/qml/qtquick_2_4/template.xml index a1fd1c2411..58005178d5 100644 --- a/share/qtcreator/templates/qml/qtquick_2_4/template.xml +++ b/share/qtcreator/templates/qml/qtquick_2_4/template.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<template openeditor="main.qml" priority="BV" - featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.2.4"> - <displayname>Qt Quick 2.4</displayname> - <description>Creates a Qt Quick 2 UI project with a single QML file that contains the main view. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. You do not need to have the development environment installed on your computer to create and run this type of project. Requires Qt 5.4 or newer.</description> +<template openeditor="main.qml" priority="AX" + featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.Controls.1.3 QtSupport.Wizards.FeatureQtQuick.UiFiles"> + <displayname>Qt Quick Controls using .ui.qml files</displayname> + <description>Creates a Qt Quick 2 UI project that contains a ui file and uses Qt Quick Controls. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version. Requires Qt 5.4 or newer.</description> </template> |