forked from qt-creator/qt-creator
Add qtquick 2.3 and qtquickcontrols 1.2 templates
Change-Id: Id71a21b273d2d156cb55033ad6a9ae2bcf5565ca Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="E"
|
||||
<template openeditor="main.qml" priority="BZ"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.1.1">
|
||||
<displayname>Qt Quick 1.1</displayname>
|
||||
<description>Creates a Qt Quick 1 UI project with a single QML file that contains the main view. You can review Qt Quick 1 UI projects in the QML Viewer 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 4.8 or newer.</description>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="D"
|
||||
<template openeditor="main.qml" priority="BY"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.2.1">
|
||||
<displayname>Qt Quick 2.1</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.1 or newer.</description>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="C"
|
||||
<template openeditor="main.qml" priority="BX"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.2.2">
|
||||
<displayname>Qt Quick 2.2</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.2 or newer.</description>
|
||||
|
||||
19
share/qtcreator/templates/qml/qtquick_2_3/main.qml
Normal file
19
share/qtcreator/templates/qml/qtquick_2_3/main.qml
Normal file
@@ -0,0 +1,19 @@
|
||||
import QtQuick 2.3
|
||||
|
||||
Rectangle {
|
||||
width: 360
|
||||
height: 360
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
Qt.quit();
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "Hello World"
|
||||
}
|
||||
}
|
||||
|
||||
21
share/qtcreator/templates/qml/qtquick_2_3/main.qmlproject
Normal file
21
share/qtcreator/templates/qml/qtquick_2_3/main.qmlproject
Normal file
@@ -0,0 +1,21 @@
|
||||
/* File generated by Qt Creator, version 2.7.0 */
|
||||
|
||||
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" ]
|
||||
}
|
||||
6
share/qtcreator/templates/qml/qtquick_2_3/template.xml
Normal file
6
share/qtcreator/templates/qml/qtquick_2_3/template.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="BW"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.2.3">
|
||||
<displayname>Qt Quick 2.3</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.3 or newer.</description>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="B"
|
||||
<template openeditor="main.qml" priority="AZ"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.Controls.1.0">
|
||||
<displayname>Qt Quick Controls 1.0</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.1 or newer.</description>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Window 2.0
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
ApplicationWindow {
|
||||
title: qsTr("Hello World")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="A"
|
||||
<template openeditor="main.qml" priority="AY"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.Controls.1.1">
|
||||
<displayname>Qt Quick Controls 1.1</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.2 or newer.</description>
|
||||
|
||||
29
share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qml
Normal file
29
share/qtcreator/templates/qml/qtquickcontrols_1_2/main.qml
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/* File generated by Qt Creator, version 2.7.0 */
|
||||
|
||||
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" ]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="AX"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick.Controls.1.2">
|
||||
<displayname>Qt Quick Controls 1.2</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.3 or newer.</description>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="E"
|
||||
<template openeditor="main.qml" priority="BZ"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.1.1"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
viewerdir="qtquick1applicationviewer"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Window 2.0
|
||||
|
||||
Window {
|
||||
visible: true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="D"
|
||||
<template openeditor="main.qml" priority="BY"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.2.1"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
stubversionminor="5">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="C"
|
||||
<template openeditor="main.qml" priority="BX"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.2.2"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
stubversionminor="5">
|
||||
|
||||
14
share/qtcreator/templates/qtquick/qtquick_2_3/app.pro
Normal file
14
share/qtcreator/templates/qtquick/qtquick_2_3/app.pro
Normal file
@@ -0,0 +1,14 @@
|
||||
TEMPLATE = app
|
||||
|
||||
QT += qml quick
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
# QML_IMPORT_PATH #
|
||||
QML_IMPORT_PATH =
|
||||
|
||||
# Default rules for deployment.
|
||||
include(../../shared/qrcdeployment.pri)
|
||||
12
share/qtcreator/templates/qtquick/qtquick_2_3/main.cpp
Normal file
12
share/qtcreator/templates/qtquick/qtquick_2_3/main.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
20
share/qtcreator/templates/qtquick/qtquick_2_3/main.qml
Normal file
20
share/qtcreator/templates/qtquick/qtquick_2_3/main.qml
Normal file
@@ -0,0 +1,20 @@
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
Window {
|
||||
visible: true
|
||||
width: 360
|
||||
height: 360
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
Qt.quit();
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Hello World")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
5
share/qtcreator/templates/qtquick/qtquick_2_3/qml.qrc
Normal file
5
share/qtcreator/templates/qtquick/qtquick_2_3/qml.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="BW"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.2.3"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
stubversionminor="5">
|
||||
<displayname>Qt Quick 2.3</displayname>
|
||||
<description>Creates a deployable Qt Quick 2 application using the QtQuick 2.3 import. Requires Qt 5.3 or newer.</description>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="B"
|
||||
<template openeditor="main.qml" priority="AZ"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.Controls.1.0"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
stubversionminor="1">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="A"
|
||||
<template openeditor="main.qml" priority="AY"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.Controls.1.1"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
stubversionminor="1">
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
TEMPLATE = app
|
||||
|
||||
QT += qml quick widgets
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
QML_IMPORT_PATH =
|
||||
|
||||
# Default rules for deployment.
|
||||
include(../../shared/qrcdeployment.pri)
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <QApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 1.2
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Hello World")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="AX"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.Controls.1.2"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
stubversionminor="1">
|
||||
<displayname>Qt Quick Controls 1.2</displayname>
|
||||
<description>Creates a deployable Qt Quick 2 application using Qt Quick Controls. Requires Qt 5.3 or newer.</description>
|
||||
</template>
|
||||
@@ -264,6 +264,12 @@ FeatureSet BaseQtVersion::availableFeatures() const
|
||||
features |= FeatureSet(Constants::FEATURE_QT_QUICK_2_2);
|
||||
features |= FeatureSet(Constants::FEATURE_QT_QUICK_CONTROLS_1_1);
|
||||
|
||||
if (qtVersion() < QtVersionNumber(5, 3, 0))
|
||||
return features;
|
||||
|
||||
features |= FeatureSet(Constants::FEATURE_QT_QUICK_2_3);
|
||||
features |= FeatureSet(Constants::FEATURE_QT_QUICK_CONTROLS_1_2);
|
||||
|
||||
return features;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,10 +57,12 @@ const char FEATURE_QT_QUICK_2[] = "QtSupport.Wizards.FeatureQtQuick.2";
|
||||
const char FEATURE_QT_QUICK_2_0[] = "QtSupport.Wizards.FeatureQtQuick.2.0";
|
||||
const char FEATURE_QT_QUICK_2_1[] = "QtSupport.Wizards.FeatureQtQuick.2.1";
|
||||
const char FEATURE_QT_QUICK_2_2[] = "QtSupport.Wizards.FeatureQtQuick.2.2";
|
||||
const char FEATURE_QT_QUICK_2_3[] = "QtSupport.Wizards.FeatureQtQuick.2.3";
|
||||
const char FEATURE_QT_QUICK_CONTROLS[] = "QtSupport.Wizards.FeatureQtQuick.Controls";
|
||||
const char FEATURE_QT_QUICK_CONTROLS_1[] = "QtSupport.Wizards.FeatureQtQuick.Controls.1";
|
||||
const char FEATURE_QT_QUICK_CONTROLS_1_0[] = "QtSupport.Wizards.FeatureQtQuick.Controls.1.0";
|
||||
const char FEATURE_QT_QUICK_CONTROLS_1_1[] = "QtSupport.Wizards.FeatureQtQuick.Controls.1.1";
|
||||
const char FEATURE_QT_QUICK_CONTROLS_1_2[] = "QtSupport.Wizards.FeatureQtQuick.Controls.1.2";
|
||||
const char FEATURE_QT_WEBKIT[] = "QtSupport.Wizards.FeatureQtWebkit";
|
||||
const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole";
|
||||
const char FEATURE_MOBILE[] = "QtSupport.Wizards.FeatureMobile";
|
||||
|
||||
Reference in New Issue
Block a user