Commit 6d660f30 authored by Thomas Hartmann's avatar Thomas Hartmann

Make QtQuick QML wizards more consistent

With this patch there is a Qt Quick 2.4 and a Qt Quick Controls 1.3 wizard
that both use .ui.qml files, but only the wizard for controls actually
uses controls. Using .ui.qml files is now the default for the latest versions.

Change-Id: I0d6c4d6878c0052330387339562831af37aa482b
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@digia.com>
parent 9ca3791e
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.1
import QtQuick 2.3
Item {
width: 640
height: 480
Rectangle {
property alias mouseArea: mouseArea
property alias button3: button3
property alias button2: button2
property alias button1: button1
width: 360
height: 360
RowLayout {
anchors.centerIn: parent
Button {
id: button1
text: qsTr("Press Me 1")
}
Button {
id: button2
text: qsTr("Press Me 2")
}
MouseArea {
id: mouseArea
anchors.fill: parent
}
Button {
id: button3
text: qsTr("Press Me 3")
}
Text {
anchors.centerIn: parent
text: "Hello World"
}
}
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
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();
}
}
}
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"))
MainForm {
mouseArea.onClicked: {
Qt.quit();
}
MessageDialog {
id: messageDialog
title: qsTr("May I have your attention please")
function show(caption) {
messageDialog.text = caption;
messageDialog.open();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<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 openeditor="main.qml" priority="BV"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.UiFiles">
<displayname>Qt Quick 2.4</displayname>
<description>Creates a Qt Quick 2 UI project that contains a .ui.qml file. You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. Requires Qt 5.4 or newer.</description>
</template>
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")
}
}
}
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
ApplicationWindow {
title: qsTr("Hello World")
......@@ -9,21 +10,32 @@ ApplicationWindow {
menuBar: MenuBar {
Menu {
title: qsTr("File")
title: qsTr("&File")
MenuItem {
text: qsTr("&Open")
onTriggered: console.log("Open action triggered");
onTriggered: messageDialog.show(qsTr("Open action triggered"));
}
MenuItem {
text: qsTr("Exit")
text: qsTr("E&xit")
onTriggered: Qt.quit();
}
}
}
Button {
text: qsTr("Hello World")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
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();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="AW"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.Controls.1.3">
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.Controls.1.3 QtSupport.Wizards.FeatureQtQuick.UiFiles">
<displayname>Qt Quick Controls 1.3</displayname>
<description>Creates a Qt Quick 2 UI project with a single QML file that contains the main view 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>
<description>Creates a Qt Quick 2 UI project that contains a .ui.qml 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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment