Commit 91bce7ab authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Removing wizards for QtQuick.Controls 1

Change-Id: I29d588021a5bf44af7a8f53e71363b96713d576c
Reviewed-by: Alessandro Portale's avatarAlessandro Portale <alessandro.portale@qt.io>
parent ba30a565
import QtQuick %{QtQuickVersion}
import QtQuick.Controls %{QtQuickControlsVersion}
import QtQuick.Layouts %{QtQuickLayoutsVersion}
Item {
width: 640
height: 480
property alias button1: button1
property alias button2: button2
RowLayout {
anchors.centerIn: parent
Button {
id: button1
text: qsTr("Press Me 1")
}
Button {
id: button2
text: qsTr("Press Me 2")
}
}
}
TEMPLATE = app
@if %{UseQApplication}
QT += qml quick widgets
@else
QT += qml quick
@endif
CONFIG += c++11
SOURCES += %{MainCppFileName}
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], [%{UseQApplication} ? "QtWidgets/QApplication" : "QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
int main(int argc, char *argv[])
{
@if %{UseQApplication}
QApplication app(argc, argv);
@else
QGuiApplication app(argc, argv);
@endif
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}
import QtQuick %{QtQuickVersion}
import QtQuick.Controls %{QtQuickControlsVersion}
@if %{IsUiFileInUse}
import QtQuick.Dialogs %{QtQuickDialogsVersion}
@endif
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("&Open")
onTriggered: console.log("Open action triggered");
}
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
@if %{IsUiFileInUse}
MainForm {
anchors.fill: parent
button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
}
MessageDialog {
id: messageDialog
title: qsTr("May I have your attention, please?")
function show(caption) {
messageDialog.text = caption;
messageDialog.open();
}
}
@else
Label {
text: qsTr("Hello World")
anchors.centerIn: parent
}
@endif
}
<RCC>
<qresource prefix="/">
<file>main.qml</file>
@if %{IsUiFileInUse}
<file>MainForm.ui.qml</file>
@endif
</qresource>
</RCC>
{
"version": 1,
"supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ],
"id": "V.QtQuickControlsApplication",
"category": "F.Application",
"trDescription": "Creates a deployable Qt Quick 2 application using Qt Quick Controls.",
"trDisplayName": "Qt Quick Controls Application",
"trDisplayCategory": "Application",
"icon": "../qtquickapplication/qml_wizard.png",
"featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.3" ],
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}",
"options":
[
{ "key": "ProFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" },
{ "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
{ "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.qtQuickVersion}" },
{ "key": "QtQuickControlsVersion", "value": "%{JS: %{QtVersion}.qtQuickControlsVersion}" },
{ "key": "QtQuickDialogsVersion", "value": "%{JS: %{QtVersion}.qtQuickDialogsVersion}" },
{ "key": "QtQuickLayoutsVersion", "value": "%{JS: %{QtVersion}.qtQuickLayoutsVersion}" },
{ "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" },
{ "key": "UiSupport", "value": "%{JS: '%{QtQuickVersion}' !== '2.3' }" },
{ "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" }
],
"pages":
[
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project"
},
{
"trDisplayName": "Define Project Details",
"trShortTitle": "Details",
"typeId": "Fields",
"data":
[
{
"name": "QtVersion",
"trDisplayName": "Minimal required Qt version:",
"type": "ComboBox",
"data":
{
"index": 2,
"items":
[
{
"trKey": "Qt 5.7",
"value":
"{
'qtQuickVersion': '2.7',
'qtQuickControlsVersion': '1.5',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.3'
}"
},
{
"trKey": "Qt 5.6",
"value":
"{
'qtQuickVersion': '2.6',
'qtQuickControlsVersion': '1.5',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.3'
}"
},
{
"trKey": "Qt 5.5",
"value":
"{
'qtQuickVersion': '2.5',
'qtQuickControlsVersion': '1.4',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.2'
}"
},
{
"trKey": "Qt 5.4",
"value":
"{
'qtQuickVersion': '2.4',
'qtQuickControlsVersion': '1.3',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.1'
}"
},
{
"trKey": "Qt 5.3",
"value":
"{
'qtQuickVersion': '2.3',
'qtQuickControlsVersion': '1.2',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.1'
}"
}
]
}
},
{
"name": "QmlUiSplit",
"trDisplayName": "With ui.qml file",
"type": "CheckBox",
"visible": "%{UiSupport}",
"data":
{
"checked": true
}
},
{
"name": "UseQApplication",
"trDisplayName": "Enable native styling. Requires dependency on the QtWidgets module.",
"type": "CheckBox",
"data":
{
"checked": true
}
}
]
},
{
"trDisplayName": "Kit Selection",
"trShortTitle": "Kits",
"typeId": "Kits",
"data": {
"projectFilePath": "%{ProFileName}",
"requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ]
}
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators":
[
{
"typeId": "File",
"data":
[
{
"source": "app.pro",
"target": "%{ProFileName}",
"openAsProject": true
},
{
"source": "main.cpp",
"target": "%{MainCppFileName}"
},
{
"source": "main.qml.tpl",
"target": "main.qml",
"openInEditor": true
},
{
"source": "MainForm.ui.qml.tpl",
"target": "MainForm.ui.qml",
"condition": "%{IsUiFileInUse}"
},
{
"source": "qml.qrc"
},
{
"source": "../../git.ignore",
"target": "%{ProjectDirectory}/.gitignore",
"condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}"
}
]
}
]
}
/* File generated by Qt Creator */
import QmlProject 1.1
Project {
mainFile: "%{MainQmlFileName}"
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
// importPaths: [ "../exampleplugin" ]
}
{
"version": 1,
"supportedProjectTypes": [ "QmlProjectManager.QmlProject" ],
"id": "QB.QtQuickControlsUi",
"category": "H.Project",
"trDescription": "Creates a Qt Quick 2 UI project using Qt Quick Controls with a QML entry point. To use it, you need to have a QML runtime environment such as qmlscene set up. Consider using a Qt Quick Controls Application project instead.",
"trDisplayName": "Qt Quick Controls UI",
"trDisplayCategory": "Other Project",
"icon": "../../qmake/qtquickapplication/qml_wizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.Controls.1.3", "QtSupport.Wizards.FeatureQtQuickProject", "QtSupport.Wizards.FeatureQt" ],
"options":
[
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qmlproject')}" },
{ "key": "MainQmlFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qml')}" },
{ "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.qtQuickVersion}" },
{ "key": "QtQuickControlsVersion", "value": "%{JS: %{QtVersion}.qtQuickControlsVersion}" },
{ "key": "QtQuickDialogsVersion", "value": "%{JS: %{QtVersion}.qtQuickDialogsVersion}" },
{ "key": "QtQuickLayoutsVersion", "value": "%{JS: %{QtVersion}.qtQuickLayoutsVersion}" },
{ "key": "UiSupport", "value": "%{JS: '%{QtQuickVersion}' !== '2.3' }" },
{ "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" }
],
"pages":
[
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project"
},
{
"trDisplayName": "Define Project Details",
"trShortTitle": "Details",
"typeId": "Fields",
"data":
[
{
"name": "QtVersion",
"trDisplayName": "Minimal required Qt version:",
"type": "ComboBox",
"data":
{
"items":
[
{
"trKey": "Qt 5.6",
"value":
"{
'qtQuickVersion': '2.6',
'qtQuickControlsVersion': '1.5',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.3'
}"
},
{
"trKey": "Qt 5.5",
"value":
"{
'qtQuickVersion': '2.5',
'qtQuickControlsVersion': '1.3',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.2'
}"
},
{
"trKey": "Qt 5.4",
"value":
"{
'qtQuickVersion': '2.4',
'qtQuickControlsVersion': '1.2',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.1'
}"
},
{
"trKey": "Qt 5.3",
"value":
"{
'qtQuickVersion': '2.3',
'qtQuickControlsVersion': '1.2',
'qtQuickDialogsVersion': '1.2',
'qtQuickLayoutsVersion': '1.1'
}"
}
]
}
},
{
"name": "QmlUiSplit",
"trDisplayName": "With ui.qml file",
"type": "CheckBox",
"visible": "%{UiSupport}",
"data":
{
"checked": true
}
}
]
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators":
[
{
"typeId": "File",
"data":
[
{
"source": "app.qmlproject",
"target": "%{QmlProjectFileName}",
"openAsProject": true
},
{
"source": "../../qmake/qtquickcontrolsapplication/main.qml.tpl",
"target": "%{ProjectDirectory}/%{MainQmlFileName}",
"openInEditor": true
},
{
"source": "../../qmake/qtquickcontrolsapplication/MainForm.ui.qml.tpl",
"target": "%{ProjectDirectory}/MainForm.ui.qml",
"condition": "%{IsUiFileInUse}"
},
{
"source": "../../git.ignore",
"target": "%{ProjectDirectory}/.gitignore",
"condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}"
}
]
}
]
}
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