diff --git a/share/qtcreator/templates/qml/qtquick_1_1/main.qml b/share/qtcreator/templates/qml/qtquick_1_1/main.qml deleted file mode 100644 index e07ec04d127..00000000000 --- a/share/qtcreator/templates/qml/qtquick_1_1/main.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 1.1 - -Rectangle { - width: 360 - height: 360 - - MouseArea { - anchors.fill: parent - onClicked: { - Qt.quit(); - } - } - - Text { - anchors.centerIn: parent - text: "Hello World" - } -} - diff --git a/share/qtcreator/templates/qml/qtquick_1_1/template.xml b/share/qtcreator/templates/qml/qtquick_1_1/template.xml deleted file mode 100644 index 75b8be65965..00000000000 --- a/share/qtcreator/templates/qml/qtquick_1_1/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquick_2_1/main.qml b/share/qtcreator/templates/qml/qtquick_2_1/main.qml deleted file mode 100644 index 542624b230d..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_1/main.qml +++ /dev/null @@ -1,20 +0,0 @@ -import QtQuick 2.1 - -Rectangle { - width: 360 - height: 360 - - MouseArea { - anchors.fill: parent - onClicked: { - Qt.quit(); - } - } - - Text { - anchors.centerIn: parent - text: "Hello World" - } - -} - diff --git a/share/qtcreator/templates/qml/qtquick_2_1/main.qmlproject b/share/qtcreator/templates/qml/qtquick_2_1/main.qmlproject deleted file mode 100644 index 63dafff88ed..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_1/main.qmlproject +++ /dev/null @@ -1,21 +0,0 @@ -/* File generated by Qt Creator */ - -import QmlProject 1.1 - -Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" - - /* 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" ] -} diff --git a/share/qtcreator/templates/qml/qtquick_2_1/template.xml b/share/qtcreator/templates/qml/qtquick_2_1/template.xml deleted file mode 100644 index 7cffb946a40..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_1/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquick_2_2/main.qml b/share/qtcreator/templates/qml/qtquick_2_2/main.qml deleted file mode 100644 index 6d2ddd88796..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_2/main.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.2 - -Rectangle { - width: 360 - height: 360 - - MouseArea { - anchors.fill: parent - onClicked: { - Qt.quit(); - } - } - - Text { - anchors.centerIn: parent - text: "Hello World" - } -} - diff --git a/share/qtcreator/templates/qml/qtquick_2_2/template.xml b/share/qtcreator/templates/qml/qtquick_2_2/template.xml deleted file mode 100644 index 9a005c2997c..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_2/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquick_2_3/main.qml b/share/qtcreator/templates/qml/qtquick_2_3/main.qml deleted file mode 100644 index 58f5c65a02f..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_3/main.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.3 - -Rectangle { - width: 360 - height: 360 - - MouseArea { - anchors.fill: parent - onClicked: { - Qt.quit(); - } - } - - Text { - anchors.centerIn: parent - text: "Hello World" - } -} - diff --git a/share/qtcreator/templates/qml/qtquick_2_3/main.qmlproject b/share/qtcreator/templates/qml/qtquick_2_3/main.qmlproject deleted file mode 100644 index 63dafff88ed..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_3/main.qmlproject +++ /dev/null @@ -1,21 +0,0 @@ -/* File generated by Qt Creator */ - -import QmlProject 1.1 - -Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" - - /* 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" ] -} diff --git a/share/qtcreator/templates/qml/qtquick_2_3/template.xml b/share/qtcreator/templates/qml/qtquick_2_3/template.xml deleted file mode 100644 index 36e776d746f..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_3/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquick_2_4/MainForm.ui.qml b/share/qtcreator/templates/qml/qtquick_2_4/MainForm.ui.qml deleted file mode 100644 index 2e696443642..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_4/MainForm.ui.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.3 - -Rectangle { - property alias mouseArea: mouseArea - - width: 360 - height: 360 - - MouseArea { - id: mouseArea - anchors.fill: parent - } - - Text { - anchors.centerIn: parent - text: "Hello World" - } -} diff --git a/share/qtcreator/templates/qml/qtquick_2_4/main.qml b/share/qtcreator/templates/qml/qtquick_2_4/main.qml deleted file mode 100644 index 4cdb6ce4346..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_4/main.qml +++ /dev/null @@ -1,8 +0,0 @@ -import QtQuick 2.4 - -MainForm { - mouseArea.onClicked: { - Qt.quit(); - } - -} diff --git a/share/qtcreator/templates/qml/qtquick_2_4/main.qmlproject b/share/qtcreator/templates/qml/qtquick_2_4/main.qmlproject deleted file mode 100644 index 63dafff88ed..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_4/main.qmlproject +++ /dev/null @@ -1,21 +0,0 @@ -/* File generated by Qt Creator */ - -import QmlProject 1.1 - -Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" - - /* 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" ] -} diff --git a/share/qtcreator/templates/qml/qtquick_2_4/template.xml b/share/qtcreator/templates/qml/qtquick_2_4/template.xml deleted file mode 100644 index aab8b4b45aa..00000000000 --- a/share/qtcreator/templates/qml/qtquick_2_4/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_0/main.qml b/share/qtcreator/templates/qml/qtquickcontrols_1_0/main.qml deleted file mode 100644 index 51f84b51061..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_0/main.qml +++ /dev/null @@ -1,29 +0,0 @@ -import QtQuick 2.1 -import QtQuick.Controls 1.0 -import QtQuick.Window 2.0 - -ApplicationWindow { - title: qsTr("Hello World") - width: 640 - height: 480 - - menuBar: MenuBar { - Menu { - title: qsTr("File") - MenuItem { - text: qsTr("&Open") - onTriggered: console.log("Open action triggered"); - } - MenuItem { - text: qsTr("Exit") - onTriggered: Qt.quit(); - } - } - } - - Button { - text: qsTr("Hello World") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - } -} diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_0/main.qmlproject b/share/qtcreator/templates/qml/qtquickcontrols_1_0/main.qmlproject deleted file mode 100644 index 63dafff88ed..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_0/main.qmlproject +++ /dev/null @@ -1,21 +0,0 @@ -/* File generated by Qt Creator */ - -import QmlProject 1.1 - -Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" - - /* 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" ] -} diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_0/template.xml b/share/qtcreator/templates/qml/qtquickcontrols_1_0/template.xml deleted file mode 100644 index 766a047dcac..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_0/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_1/main.qml b/share/qtcreator/templates/qml/qtquickcontrols_1_1/main.qml deleted file mode 100644 index f5f228ebfb7..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_1/main.qml +++ /dev/null @@ -1,29 +0,0 @@ -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Window 2.1 - -ApplicationWindow { - title: qsTr("Hello World") - width: 640 - height: 480 - - menuBar: MenuBar { - Menu { - title: qsTr("File") - MenuItem { - text: qsTr("&Open") - onTriggered: console.log("Open action triggered"); - } - MenuItem { - text: qsTr("Exit") - onTriggered: Qt.quit(); - } - } - } - - Button { - text: qsTr("Hello World") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - } -} diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_1/main.qmlproject b/share/qtcreator/templates/qml/qtquickcontrols_1_1/main.qmlproject deleted file mode 100644 index 63dafff88ed..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_1/main.qmlproject +++ /dev/null @@ -1,21 +0,0 @@ -/* File generated by Qt Creator */ - -import QmlProject 1.1 - -Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" - - /* 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" ] -} diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_1/template.xml b/share/qtcreator/templates/qml/qtquickcontrols_1_1/template.xml deleted file mode 100644 index 7a0b3d26bc1..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_1/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qml b/share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qml deleted file mode 100644 index 8e9f3a8acce..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qml +++ /dev/null @@ -1,29 +0,0 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 -import QtQuick.Window 2.2 - -ApplicationWindow { - title: qsTr("Hello World") - width: 640 - height: 480 - - menuBar: MenuBar { - Menu { - title: qsTr("File") - MenuItem { - text: qsTr("&Open") - onTriggered: console.log("Open action triggered"); - } - MenuItem { - text: qsTr("Exit") - onTriggered: Qt.quit(); - } - } - } - - Button { - text: qsTr("Hello World") - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - } -} diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qmlproject b/share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qmlproject deleted file mode 100644 index 63dafff88ed..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qmlproject +++ /dev/null @@ -1,21 +0,0 @@ -/* File generated by Qt Creator */ - -import QmlProject 1.1 - -Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" - - /* 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" ] -} diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_2/template.xml b/share/qtcreator/templates/qml/qtquickcontrols_1_2/template.xml deleted file mode 100644 index a8773c8b2d9..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_2/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_3/MainForm.ui.qml b/share/qtcreator/templates/qml/qtquickcontrols_1_3/MainForm.ui.qml deleted file mode 100644 index e557debb83b..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_3/MainForm.ui.qml +++ /dev/null @@ -1,31 +0,0 @@ -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/qtquickcontrols_1_3/main.qml b/share/qtcreator/templates/qml/qtquickcontrols_1_3/main.qml deleted file mode 100644 index f9d19d4379e..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_3/main.qml +++ /dev/null @@ -1,41 +0,0 @@ -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")) - } - - 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/qtquickcontrols_1_3/main.qmlproject b/share/qtcreator/templates/qml/qtquickcontrols_1_3/main.qmlproject deleted file mode 100644 index 63dafff88ed..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_3/main.qmlproject +++ /dev/null @@ -1,21 +0,0 @@ -/* File generated by Qt Creator */ - -import QmlProject 1.1 - -Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" - - /* 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" ] -} diff --git a/share/qtcreator/templates/qml/qtquickcontrols_1_3/template.xml b/share/qtcreator/templates/qml/qtquickcontrols_1_3/template.xml deleted file mode 100644 index 46688bbe626..00000000000 --- a/share/qtcreator/templates/qml/qtquickcontrols_1_3/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/src/plugins/qmlprojectmanager/images/qml_wizard.png b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/qml_wizard.png similarity index 100% rename from src/plugins/qmlprojectmanager/images/qml_wizard.png rename to share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/qml_wizard.png diff --git a/share/qtcreator/templates/qml/qtquick_2_2/main.qmlproject b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/app.qmlproject similarity index 87% rename from share/qtcreator/templates/qml/qtquick_2_2/main.qmlproject rename to share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/app.qmlproject index 63dafff88ed..c6519187e5b 100644 --- a/share/qtcreator/templates/qml/qtquick_2_2/main.qmlproject +++ b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/app.qmlproject @@ -3,8 +3,7 @@ import QmlProject 1.1 Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" + mainFile: "%{MainQmlFileName}" /* Include .qml, .js, and image files from current directory and subdirectories */ QmlFiles { diff --git a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json new file mode 100644 index 00000000000..550ffed700e --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json @@ -0,0 +1,117 @@ +{ + "version": 1, + "kind": "project", + "id": "QA.QMLB Application", + "category": "F.Application", + "trDescription": "Creates a Qt Quick 2 UI project.", + "trDisplayName": "Qt Quick UI", + "trDisplayCategory": "Application", + "icon": "../../qmake/qtquickapplication/qml_wizard.png", + "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": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.qtQuickWindowVersion}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": { "trDescription": "Creates a Qt Quick UI project." } + }, + { + "trDisplayName": "Define Project Details", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "QtVersion", + "trDisplayName": "Minimal required Qt version:", + "type": "ComboBox", + "data": + { + "items": + [ + { + "trKey": "Qt 5.5", + "value": + "{ + 'qtQuickVersion': '2.5', + 'qtQuickWindowVersion': '2.2' + }" + }, + { + "trKey": "Qt 5.4", + "value": + "{ + 'qtQuickVersion': '2.4', + 'qtQuickWindowVersion': '2.2' + }" + }, + { + "trKey": "Qt 5.3", + "value": + "{ + 'qtQuickVersion': '2.3', + 'qtQuickWindowVersion': '2.2' + }" + } + ] + } + }, + { + "name": "QmlUISplit", + "trDisplayName": "With ui.qml file", + "type": "CheckBox", + "data": + { + "checkedValue": true, + "uncheckedValue": false, + "checked": false + } + } + ] + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "app.qmlproject", + "target": "%{QmlProjectFileName}", + "openAsProject": true + }, + { + "source": "../../qmake/qtquickapplication/main.qml", + "target": "%{ProjectDirectory}/%{MainQmlFileName}", + "openInEditor": true + }, + { + "source": "../../qmake/qtquickapplication/MainForm.ui.qml", + "target": "%{ProjectDirectory}/MainForm.ui.qml", + "condition": "%{QmlUISplit}" + }, + { + "source": "../../qmake/git.ignore", + "target": "%{ProjectDirectory}/.gitignore", + "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + } + ] + } + ] +} diff --git a/share/qtcreator/templates/qml/qtquick_1_1/main.qmlproject b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/app.qmlproject similarity index 87% rename from share/qtcreator/templates/qml/qtquick_1_1/main.qmlproject rename to share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/app.qmlproject index 63dafff88ed..c6519187e5b 100644 --- a/share/qtcreator/templates/qml/qtquick_1_1/main.qmlproject +++ b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/app.qmlproject @@ -3,8 +3,7 @@ import QmlProject 1.1 Project { -// QTC_REPLACE main.qml WITH main - mainFile: "main.qml" + mainFile: "%{MainQmlFileName}" /* Include .qml, .js, and image files from current directory and subdirectories */ QmlFiles { diff --git a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/wizard.json new file mode 100644 index 00000000000..eb59f424516 --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickcontrolsapplication/wizard.json @@ -0,0 +1,125 @@ +{ + "version": 1, + "kind": "project", + "id": "QA.QMLB Application", + "category": "F.Application", + "trDescription": "Creates a Qt Quick 2 UI project using Qt Quick Controls.", + "trDisplayName": "Qt Quick Controls UI", + "trDisplayCategory": "Application", + "icon": "../../qmake/qtquickapplication/qml_wizard.png", + "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}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": { "trDescription": "Creates a Qt Quick UI project using Qt Quick Controls." } + }, + { + "trDisplayName": "Define Project Details", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "QtVersion", + "trDisplayName": "Minimal required Qt version:", + "type": "ComboBox", + "data": + { + "items": + [ + { + "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", + "data": + { + "checkedValue": true, + "uncheckedValue": false, + "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", + "target": "%{ProjectDirectory}/%{MainQmlFileName}", + "openInEditor": true + }, + { + "source": "../../qmake/qtquickcontrolsapplication/MainForm.ui.qml", + "target": "%{ProjectDirectory}/MainForm.ui.qml", + "condition": "%{QmlUISplit}" + }, + { + "source": "../../qmake/git.ignore", + "target": "%{ProjectDirectory}/.gitignore", + "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + } + ] + } + ] +} diff --git a/src/plugins/qmlprojectmanager/qmlapp.cpp b/src/plugins/qmlprojectmanager/qmlapp.cpp deleted file mode 100644 index 32015d4a89d..00000000000 --- a/src/plugins/qmlprojectmanager/qmlapp.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://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 http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "qmlapp.h" - -#include -#include -#include -#include - -#include -#include -#include - -namespace QmlProjectManager { -namespace Internal { - -static QStringList binaryFiles() -{ - static QStringList result; - if (result.isEmpty()) - result << QLatin1String("png") << QLatin1String("jpg") << QLatin1String("jpeg"); - return result; -} - -static QString templateRootDirectory() -{ - return Core::ICore::resourcePath() + QLatin1String("/templates/qml/"); -} - -QmlApp::QmlApp(QObject *parent) - : QObject(parent) -{ -} - -QmlApp::~QmlApp() -{ -} - -QString QmlApp::mainQmlFileName() const -{ - return projectName() + QLatin1String(".qml"); -} - -void QmlApp::setProjectNameAndBaseDirectory(const QString &projectName, const QString &projectBaseDirectory) -{ - m_projectBaseDirectory = projectBaseDirectory; - m_projectName = projectName.trimmed(); -} - -QString QmlApp::projectDirectory() const -{ - return QDir::cleanPath(m_projectBaseDirectory + QLatin1Char('/') + m_projectName); -} - -QString QmlApp::projectName() const -{ - return m_projectName; -} - -void QmlApp::setTemplateInfo(const TemplateInfo &templateInfo) -{ - m_templateInfo = templateInfo; -} - -QString QmlApp::creatorFileName() const -{ - return m_creatorFileName; -} - -QString QmlApp::templateDirectory() const -{ - const QDir dir(templateRootDirectory() + m_templateInfo.templateName); - return QDir::cleanPath(dir.absolutePath()); -} - -static QStringList templateNames() -{ - QStringList templateNameList; - const QDir templateRoot(templateRootDirectory()); - - foreach (const QFileInfo &subDirectory, - templateRoot.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) - templateNameList.append(subDirectory.fileName()); - - return templateNameList; -} - -// Return locale language attribute "de_UTF8" -> "de", empty string for "C" -static QString languageSetting() -{ -#ifdef QT_CREATOR - QString name = Core::ICore::userInterfaceLanguage(); - const int underScorePos = name.indexOf(QLatin1Char('_')); - if (underScorePos != -1) - name.truncate(underScorePos); - if (name.compare(QLatin1String("C"), Qt::CaseInsensitive) == 0) - name.clear(); - return name; -#else - return QLocale::system().name(); -#endif -} - -static inline bool assignLanguageElementText(QXmlStreamReader &reader, - const QString &desiredLanguage, - QString *target) -{ - const QStringRef elementLanguage = reader.attributes().value(QLatin1String("xml:lang")); - if (elementLanguage.isEmpty()) { - // Try to find a translation for our Wizards - *target = QCoreApplication::translate("QmlProjectManager::QmlApplicationWizard", - reader.readElementText().toLatin1().constData()); - return true; - } - if (elementLanguage == desiredLanguage) { - *target = reader.readElementText(); - return true; - } - return false; -} - -static bool parseTemplateXml(QXmlStreamReader &reader, TemplateInfo *info) -{ - const QString locale = languageSetting(); - - static const QLatin1String tag_template("template"); - static const QLatin1String tag_displayName("displayname"); - static const QLatin1String tag_description("description"); - static const QLatin1String attribute_featuresRequired("featuresRequired"); - static const QLatin1String attribute_openEditor("openeditor"); - static const QLatin1String attribute_priority("priority"); - - while (!reader.atEnd() && !reader.hasError()) { - reader.readNext(); - if (reader.tokenType() != QXmlStreamReader::StartElement) - continue; - - if (reader.name() == tag_template) { - info->openFile = reader.attributes().value(attribute_openEditor).toString(); - if (reader.attributes().hasAttribute(attribute_priority)) - info->priority = reader.attributes().value(attribute_priority).toString(); - - if (reader.attributes().hasAttribute(attribute_featuresRequired)) - info->featuresRequired = reader.attributes().value(attribute_featuresRequired).toString(); - - } else if (reader.name() == tag_displayName) { - if (!assignLanguageElementText(reader, locale, &info->displayName)) - continue; - } else if (reader.name() == tag_description) { - if (!assignLanguageElementText(reader, locale, &info->description)) - continue; - } - } - if (reader.hasError()) { - qWarning() << reader.errorString(); - return false; - } - - return true; -} - -class TemplateInfoList -{ -public: - TemplateInfoList() - { - QMultiMap multiMap; - foreach (const QString &templateName, templateNames()) { - const QString templatePath = templateRootDirectory() + templateName; - QFile xmlFile(templatePath + QLatin1String("/template.xml")); - if (!xmlFile.open(QIODevice::ReadOnly)) { - qWarning().nospace() << QString::fromLatin1("Cannot open %1").arg(QDir::toNativeSeparators(QFileInfo(xmlFile.fileName()).absoluteFilePath())); - continue; - } - TemplateInfo info; - info.templateName = templateName; - info.templatePath = templatePath; - QXmlStreamReader reader(&xmlFile); - if (parseTemplateXml(reader, &info)) - multiMap.insert(info.priority, info); - } - m_templateInfoList = multiMap.values(); - } - QList templateInfoList() const { return m_templateInfoList; } - -private: - QList m_templateInfoList; -}; - -Q_GLOBAL_STATIC(TemplateInfoList, templateInfoList) - -QList QmlApp::templateInfos() -{ - return templateInfoList()->templateInfoList(); -} - -static QFileInfoList allFilesRecursive(const QString &path) -{ - const QDir currentDirectory(path); - - QFileInfoList allFiles = currentDirectory.entryInfoList(QDir::Files); - - foreach (const QFileInfo &subDirectory, currentDirectory.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) - allFiles.append(allFilesRecursive(subDirectory.absoluteFilePath())); - - return allFiles; -} - -QByteArray QmlApp::readFile(const QString &filePath, bool &ok) const -{ - Utils::FileReader reader; - - if (!reader.fetch(filePath)) { - ok = false; - return QByteArray(); - } - - ok = true; - return reader.data(); -} - -QString QmlApp::readAndAdaptTemplateFile(const QString &filePath, bool &ok) const -{ - const QByteArray originalTemplate = readFile(filePath, ok); - if (!ok) - return QString(); - - QTextStream tsIn(originalTemplate); - QByteArray adaptedTemplate; - QTextStream tsOut(&adaptedTemplate, QIODevice::WriteOnly | QIODevice::Text); - int lineNr = 1; - QString line; - do { - static const QString markerQtcReplace = QLatin1String("QTC_REPLACE"); - static const QString markerWith = QLatin1String("WITH"); - - line = tsIn.readLine(); - const int markerQtcReplaceIndex = line.indexOf(markerQtcReplace); - if (markerQtcReplaceIndex >= 0) { - QString replaceXWithYString = line.mid(markerQtcReplaceIndex + markerQtcReplace.length()).trimmed(); - if (filePath.endsWith(QLatin1String(".json"))) - replaceXWithYString.replace(QRegExp(QLatin1String("\",$")), QString()); - else if (filePath.endsWith(QLatin1String(".html"))) - replaceXWithYString.replace(QRegExp(QLatin1String(" -->$")), QString()); - const QStringList replaceXWithY = replaceXWithYString.split(markerWith); - if (replaceXWithY.count() != 2) { - qWarning().nospace() << QString::fromLatin1("Error in %1:%2. Invalid %3 options.") - .arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(markerQtcReplace); - ok = false; - return QString(); - } - const QString replaceWhat = replaceXWithY.at(0).trimmed(); - const QString replaceWith = replaceXWithY.at(1).trimmed(); - if (!m_replacementVariables.contains(replaceWith)) { - qWarning().nospace() << QString::fromLatin1("Error in %1:%2. Unknown %3 option \"%4\".") - .arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(markerQtcReplace).arg(replaceWith); - ok = false; - return QString(); - } - line = tsIn.readLine(); // Following line which is to be patched. - lineNr++; - if (line.indexOf(replaceWhat) < 0) { - qWarning().nospace() << QString::fromLatin1("Error in %1:%2. Replacement \"%3\" not found.") - .arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(replaceWhat); - ok = false; - return QString(); - } - line.replace(replaceWhat, m_replacementVariables.value(replaceWith)); - } - if (!line.isNull()) - tsOut << line << endl; - lineNr++; - } while (!line.isNull()); - - ok = true; - return QString::fromUtf8(adaptedTemplate); -} - -bool QmlApp::addTemplate(const QString &sourceDirectory, - const QString &templateFileName, - const QString &tragetDirectory, - const QString &targetFileName, - Core::GeneratedFiles *files, - QString *errorMessage) const -{ - bool fileIsReadable; - Core::GeneratedFile file(tragetDirectory + QLatin1Char('/') + targetFileName); - - const QString &data = readAndAdaptTemplateFile(sourceDirectory + QLatin1Char('/') + templateFileName, fileIsReadable); - - if (!fileIsReadable) { - if (errorMessage) - *errorMessage = QCoreApplication::translate("QmlApplicationWizard", "Failed to read %1 template.").arg(templateFileName); - return false; - } - - file.setContents(data); - files->append(file); - - return true; -} - -bool QmlApp::addBinaryFile(const QString &sourceDirectory, - const QString &templateFileName, - const QString &tragetDirectory, - const QString &targetFileName, - Core::GeneratedFiles *files, - QString *errorMessage) const -{ - bool fileIsReadable; - - Core::GeneratedFile file(tragetDirectory + targetFileName); - file.setBinary(true); - - const QByteArray &data = readFile(sourceDirectory + QLatin1Char('/') + templateFileName, fileIsReadable); - - if (!fileIsReadable) { - if (errorMessage) - *errorMessage = QCoreApplication::translate("QmlApplicationWizard", "Failed to read file %1.").arg(templateFileName); - return false; - } - - file.setBinaryContents(data); - files->append(file); - - return true; -} - -QString QmlApp::renameQmlFile(const QString &fileName) { - if (fileName == QLatin1String("main.qml")) - return mainQmlFileName(); - return fileName; -} - -Core::GeneratedFiles QmlApp::generateFiles(QString *errorMessage) -{ - Core::GeneratedFiles files; - - QTC_ASSERT(errorMessage, return files); - - errorMessage->clear(); - setReplacementVariables(); - const QFileInfoList templateFiles = allFilesRecursive(templateDirectory()); - - foreach (const QFileInfo &templateFile, templateFiles) { - const QString targetSubDirectory = templateFile.path().mid(templateDirectory().length()); - const QString targetDirectory = projectDirectory() + targetSubDirectory + QLatin1Char('/'); - - QString targetFileName = templateFile.fileName(); - - if (templateFile.fileName() == QLatin1String("main.pro")) { - targetFileName = projectName() + QLatin1String(".pro"); - m_creatorFileName = Core::BaseFileWizardFactory::buildFileName(projectDirectory(), - projectName(), - QLatin1String("pro")); - } else if (templateFile.fileName() == QLatin1String("main.qmlproject")) { - targetFileName = projectName() + QLatin1String(".qmlproject"); - m_creatorFileName = Core::BaseFileWizardFactory::buildFileName(projectDirectory(), - projectName(), - QLatin1String("qmlproject")); - } else if (templateFile.fileName() == QLatin1String("main.qbp")) { - targetFileName = projectName() + QLatin1String(".qbp"); - } else if (targetFileName == QLatin1String("template.xml") - || targetFileName == QLatin1String("template.png")) { - continue; - } else { - targetFileName = renameQmlFile(templateFile.fileName()); - } - - if (binaryFiles().contains(templateFile.suffix())) { - bool canAddBinaryFile = addBinaryFile(templateFile.absolutePath(), - templateFile.fileName(), - targetDirectory, - targetFileName, - &files, - errorMessage); - if (!canAddBinaryFile) - return Core::GeneratedFiles(); - } else { - bool canAddTemplate = addTemplate(templateFile.absolutePath(), - templateFile.fileName(), - targetDirectory, - targetFileName, - &files, - errorMessage); - if (!canAddTemplate) - return Core::GeneratedFiles(); - - if (templateFile.fileName() == QLatin1String("main.pro")) - files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute); - else if (templateFile.fileName() == QLatin1String("main.qmlproject")) - files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute); - else if (templateFile.fileName() == m_templateInfo.openFile) - files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute); - } - } - - return files; -} - -void QmlApp::setReplacementVariables() -{ - m_replacementVariables.clear(); - - m_replacementVariables.insert(QLatin1String("main"), mainQmlFileName()); - m_replacementVariables.insert(QLatin1String("projectName"), projectName()); -} - -} // namespace Internal -} // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlapp.h b/src/plugins/qmlprojectmanager/qmlapp.h deleted file mode 100644 index b5a7f1270e6..00000000000 --- a/src/plugins/qmlprojectmanager/qmlapp.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://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 http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef QMLAPP_H -#define QMLAPP_H - -#include -#include -#include - -#include - -namespace QmlProjectManager { -namespace Internal { - -class TemplateInfo -{ -public: - QString templateName; - QString templatePath; - QString displayName; - QString description; - QString openFile; - QString featuresRequired; - QString priority; -}; - -class QmlApp : public QObject -{ - Q_OBJECT -public: - - QmlApp(QObject *parent = 0); - ~QmlApp(); - - QString mainQmlFileName() const; - QString projectDirectory() const; - QString projectName() const; - QString templateDirectory() const; - - static QList templateInfos(); - - Core::GeneratedFiles generateFiles(QString *errorMessage); - QString renameQmlFile(const QString &fileName); - - void setTemplateInfo(const TemplateInfo &templateInfo); - - QString creatorFileName() const; - -public slots: - void setProjectNameAndBaseDirectory(const QString &projectName, const QString &projectBaseDirectory); - -protected: - QString readAndAdaptTemplateFile(const QString &filePath, bool &ok) const; - bool addTemplate(const QString &sourceDirectory, - const QString &sourceFileName, - const QString &targetDirectory, - const QString &targetFileName, - Core::GeneratedFiles *files, - QString *errorMessage) const; - bool addBinaryFile(const QString &sourceDirectory, - const QString &sourceFileName, - const QString &targetDirectory, - const QString &targetFileName, - Core::GeneratedFiles *files, - QString *errorMessage) const; - QByteArray readFile(const QString &filePath, bool &ok) const; - -private: - void setReplacementVariables(); - - QString m_runtime; - - QString m_projectName; - QString m_projectBaseDirectory; - bool m_grantUserDataAccess; - QHash m_replacementVariables; - TemplateInfo m_templateInfo; - QString m_creatorFileName; -}; - -} // namespace Internal -} // namespace QmlProjectManager - -#endif // QMLAPP_H diff --git a/src/plugins/qmlprojectmanager/qmlapplicationwizard.cpp b/src/plugins/qmlprojectmanager/qmlapplicationwizard.cpp deleted file mode 100644 index c45bb0487eb..00000000000 --- a/src/plugins/qmlprojectmanager/qmlapplicationwizard.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://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 http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "qmlapplicationwizard.h" - -#include "qmlapp.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "qmlprojectmanager.h" -#include "qmlproject.h" -#include "qmlapplicationwizardpages.h" - -#include - -using namespace Core; -using namespace ExtensionSystem; -using namespace ProjectExplorer; -using namespace QmakeProjectManager; - -namespace QmlProjectManager { -namespace Internal { - -QmlApplicationWizardDialog::QmlApplicationWizardDialog(QWidget *parent, const WizardDialogParameters ¶meters) - : BaseProjectWizardDialog(parent, parameters) -{ - setWindowTitle(tr("New Qt Quick UI Project")); - setIntroDescription(tr("This wizard generates a Qt Quick UI project.")); - m_componentSetPage = new QmlComponentSetPage; - addPage(m_componentSetPage); -} - -TemplateInfo QmlApplicationWizardDialog::templateInfo() const -{ - return m_componentSetPage->templateInfo(); -} - - -QmlApplicationWizard::QmlApplicationWizard() - : m_qmlApp(new QmlApp(this)) -{ - setWizardKind(ProjectWizard); - setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY)); - setId(QLatin1String("QA.QMLB Application")); - setIcon(QIcon(QLatin1String(QmakeProjectManager::Constants::ICON_QTQUICK_APP))); - setDisplayCategory( - QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY)); - setDisplayName(tr("Qt Quick UI")); - setDescription(tr("Creates a Qt Quick UI project.")); - setRequiredFeatures(Feature(QtSupport::Constants::FEATURE_QMLPROJECT) - | Feature(QtSupport::Constants::FEATURE_QT_QUICK)); -} - -BaseFileWizard *QmlApplicationWizard::create(QWidget *parent, const WizardDialogParameters ¶meters) const -{ - QmlApplicationWizardDialog *wizardDialog = new QmlApplicationWizardDialog(parent, parameters); - - connect(wizardDialog, &QmlApplicationWizardDialog::projectParametersChanged, - m_qmlApp, &QmlApp::setProjectNameAndBaseDirectory); - - wizardDialog->setPath(parameters.defaultPath()); - - wizardDialog->setProjectName(QmlApplicationWizardDialog::uniqueProjectName(parameters.defaultPath())); - - foreach (QWizardPage *page, parameters.extensionPages()) - wizardDialog->addPage(page); - - return wizardDialog; -} - -GeneratedFiles QmlApplicationWizard::generateFiles(const QWizard *w, - QString *errorMessage) const -{ - const QmlApplicationWizardDialog *wizard = qobject_cast(w); - m_qmlApp->setTemplateInfo(wizard->templateInfo()); - return m_qmlApp->generateFiles(errorMessage); -} - -bool QmlApplicationWizard::postGenerateFiles(const QWizard * /*wizard*/, const GeneratedFiles &l, - QString *errorMessage) -{ - return CustomProjectWizard::postGenerateOpen(l, errorMessage); -} - -} // namespace Internal -} // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlapplicationwizard.h b/src/plugins/qmlprojectmanager/qmlapplicationwizard.h deleted file mode 100644 index e17b21a0930..00000000000 --- a/src/plugins/qmlprojectmanager/qmlapplicationwizard.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://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 http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef QMLAPPLICATIONWIZARD_H -#define QMLAPPLICATIONWIZARD_H - -#include -#include - -namespace ExtensionSystem { class IPlugin; } - -namespace QmlProjectManager { -namespace Internal { - -class QmlApp; -class TemplateInfo; -class QmlComponentSetPage; - -class QmlApplicationWizardDialog : public ProjectExplorer::BaseProjectWizardDialog -{ - Q_OBJECT -public: - QmlApplicationWizardDialog(QWidget *parent, - const Core::WizardDialogParameters ¶meters); - - TemplateInfo templateInfo() const; - -private: - QmlComponentSetPage *m_componentSetPage; -}; - - -class QmlApplicationWizard : public Core::BaseFileWizardFactory -{ - Q_OBJECT - -public: - QmlApplicationWizard(); - - static void createInstances(ExtensionSystem::IPlugin *plugin); - -private: - Core::BaseFileWizard *create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const; - Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const; - void writeUserFile(const QString &fileName) const; - bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage); - -private: - QmlApp *m_qmlApp; -}; - -} // namespace Internal -} // namespace QmlProjectManager - -#endif // QMLAPPLICATIONWIZARD_H diff --git a/src/plugins/qmlprojectmanager/qmlapplicationwizardpages.cpp b/src/plugins/qmlprojectmanager/qmlapplicationwizardpages.cpp deleted file mode 100644 index f6a0910aa2d..00000000000 --- a/src/plugins/qmlprojectmanager/qmlapplicationwizardpages.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://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 http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "qmlapplicationwizardpages.h" -#include "qmlapp.h" - -#include - -#include -#include -#include - -namespace QmlProjectManager { -namespace Internal { - -class QmlComponentSetPagePrivate -{ -public: - QComboBox *m_versionComboBox; - QLabel *m_detailedDescriptionLabel; -}; - -QmlComponentSetPage::QmlComponentSetPage(QWidget *parent) - : QWizardPage(parent) - , d(new QmlComponentSetPagePrivate) -{ - setTitle(tr("Select Qt Quick Component Set")); - QVBoxLayout *mainLayout = new QVBoxLayout(this); - QHBoxLayout *l = new QHBoxLayout(); - - QLabel *label = new QLabel(tr("Qt Quick component set:"), this); - d->m_versionComboBox = new QComboBox(this); - - foreach (const TemplateInfo &templateInfo, QmlApp::templateInfos()) - d->m_versionComboBox->addItem(templateInfo.displayName); - - l->addWidget(label); - l->addWidget(d->m_versionComboBox); - - d->m_detailedDescriptionLabel = new QLabel(this); - d->m_detailedDescriptionLabel->setWordWrap(true); - d->m_detailedDescriptionLabel->setTextFormat(Qt::RichText); - connect(d->m_versionComboBox, SIGNAL(currentIndexChanged(int)), this, - SLOT(updateDescription(int))); - updateDescription(d->m_versionComboBox->currentIndex()); - - mainLayout->addLayout(l); - mainLayout->addWidget(d->m_detailedDescriptionLabel); - - setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Component Set")); -} - -QmlComponentSetPage::~QmlComponentSetPage() -{ - delete d; -} - -TemplateInfo QmlComponentSetPage::templateInfo() const -{ - if (QmlApp::templateInfos().isEmpty()) - return TemplateInfo(); - return QmlApp::templateInfos().at(d->m_versionComboBox->currentIndex()); -} - -void QmlComponentSetPage::updateDescription(int index) -{ - if (QmlApp::templateInfos().isEmpty()) - return; - - const TemplateInfo templateInfo = QmlApp::templateInfos().at(index); - d->m_detailedDescriptionLabel->setText(templateInfo.description); -} - -} // namespace Internal -} // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlapplicationwizardpages.h b/src/plugins/qmlprojectmanager/qmlapplicationwizardpages.h deleted file mode 100644 index 215286de5bb..00000000000 --- a/src/plugins/qmlprojectmanager/qmlapplicationwizardpages.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://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 http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef QMLAPPLICATIONWIZARDPAGES_H -#define QMLAPPLICATIONWIZARDPAGES_H - -#include - -namespace QmlProjectManager { -namespace Internal { - -class TemplateInfo; - -class QmlComponentSetPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit QmlComponentSetPage(QWidget *parent = 0); - ~QmlComponentSetPage(); - - TemplateInfo templateInfo() const; - -private slots: - void updateDescription(int index); - -private: - class QmlComponentSetPagePrivate *d; -}; - -} // namespace Internal -} // namespace QmlProjectManager - -#endif // QMLAPPLICATIONWIZARDPAGES_H diff --git a/src/plugins/qmlprojectmanager/qmlproject.qrc b/src/plugins/qmlprojectmanager/qmlproject.qrc index 2443c3f9aef..31d6ba9b6df 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.qrc +++ b/src/plugins/qmlprojectmanager/qmlproject.qrc @@ -3,6 +3,5 @@ QmlProjectManager.mimetypes.xml images/qmlfolder.png images/qmlproject.png - images/qml_wizard.png diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.pro b/src/plugins/qmlprojectmanager/qmlprojectmanager.pro index 4c8a6211e4b..8545eee471a 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanager.pro +++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.pro @@ -15,10 +15,7 @@ HEADERS += qmlproject.h \ qmlprojectrunconfigurationfactory.h \ qmlprojectmanager_global.h \ qmlprojectmanagerconstants.h \ - qmlprojectrunconfigurationwidget.h \ - qmlapp.h \ - qmlapplicationwizard.h \ - qmlapplicationwizardpages.h + qmlprojectrunconfigurationwidget.h SOURCES += qmlproject.cpp \ qmlprojectenvironmentaspect.cpp \ @@ -28,9 +25,6 @@ SOURCES += qmlproject.cpp \ qmlprojectfile.cpp \ qmlprojectrunconfiguration.cpp \ qmlprojectrunconfigurationfactory.cpp \ - qmlprojectrunconfigurationwidget.cpp \ - qmlapp.cpp \ - qmlapplicationwizard.cpp \ - qmlapplicationwizardpages.cpp + qmlprojectrunconfigurationwidget.cpp RESOURCES += qmlproject.qrc diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs index ef9b6014db8..a138a95bd99 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs +++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs @@ -14,9 +14,6 @@ QtcPlugin { Group { name: "General" files: [ - "qmlapp.cpp", "qmlapp.h", - "qmlapplicationwizard.cpp", "qmlapplicationwizard.h", - "qmlapplicationwizardpages.cpp", "qmlapplicationwizardpages.h", "qmlproject.cpp", "qmlproject.h", "qmlproject.qrc", "qmlprojectconstants.h", diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp index 71e48493f35..de93e7c235a 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp @@ -32,7 +32,6 @@ #include "qmlprojectmanager.h" #include "qmlproject.h" #include "qmlprojectrunconfigurationfactory.h" -#include "qmlapplicationwizard.h" #include "fileformat/qmlprojectfileformat.h" #include @@ -64,7 +63,6 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage) addAutoReleasedObject(new Internal::Manager); addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory); - addAutoReleasedObject(new Internal::QmlApplicationWizard); Core::FileIconProvider::registerIconOverlayForSuffix(":/qmlproject/images/qmlproject.png", "qmlproject"); return true; diff --git a/src/plugins/qtsupport/qtsupportconstants.h b/src/plugins/qtsupport/qtsupportconstants.h index 2e0442a8b9a..941a58d8f54 100644 --- a/src/plugins/qtsupport/qtsupportconstants.h +++ b/src/plugins/qtsupport/qtsupportconstants.h @@ -93,11 +93,6 @@ const char WINDOWS_PHONE_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Windows const char ANDROID_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Android"); const char IOS_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "iOS"); -// QML wizard icon -// both the qmakeprojectmanager and the qmlprojectmanager do have qt quick wizards -// so we define the icon here -const char QML_WIZARD_ICON[] = ":/qmlproject/images/qml_wizard.png"; - const char ICON_QT_PROJECT[] = ":/qtsupport/images/qt_project.png"; } // namepsace Constants