Commit d3b8da6c authored by jkobus's avatar jkobus Committed by Jarek Kobus

Add qtquick 2.1, 2.2 and qtquickcontrols 1.1

Change-Id: If68e0c62781b235c2f0e573afe6d0e28709f28f3
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 5b6d31cd
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="C"
<template openeditor="main.qml" priority="F"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, 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>
......
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="A"
<template openeditor="main.qml" priority="E"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2">
<displayname>Qt Quick 2.0</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.0 or newer.</description>
......
import QtQuick 2.1
Rectangle {
width: 360
height: 360
Text {
anchors.centerIn: parent
text: "Hello World"
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
}
/* 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" ]
}
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="C"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2">
<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>
</template>
import QtQuick 2.2
Rectangle {
width: 360
height: 360
Text {
anchors.centerIn: parent
text: "Hello World"
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
}
/* 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" ]
}
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="A"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.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>
</template>
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="B"
<template openeditor="main.qml" priority="D"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2, QtSupport.Wizards.FeatureQtQuick.Controls">
<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>
......
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Window 2.0
ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
Button {
text: qsTr("Hello World")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
/* 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" ]
}
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="B"
featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2, QtSupport.Wizards.FeatureQtQuick.Controls">
<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>
</template>
......@@ -16,7 +16,7 @@ SOURCES += main.cpp
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(qtquick1applicationviewer/qtquick1applicationviewer.pri)
include(../../shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qtquick1applicationviewer.pri, instead) #
include(../../shared/deployment.pri)
qtcAddDeployment()
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="C"
<template openeditor="main.qml" priority="F"
featuresRequired="QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.1.1"
viewerdir="qtquick1applicationviewer"
viewerclassname="QtQuick1ApplicationViewer"
......
......@@ -16,7 +16,7 @@ SOURCES += main.cpp
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
include(../../shared/qtquickapplicationviewer/qtquick2applicationviewer/qtquick2applicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #
include(../../shared/deployment.pri)
qtcAddDeployment()
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="A"
<template openeditor="main.qml" priority="E"
featuresRequired="QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2"
viewerdir="qtquick2applicationviewer"
viewerclassname="QtQuick2ApplicationViewer"
......
# Add more folders to ship with the application, here
# DEPLOYMENTFOLDERS #
folder_01.source = qml/app
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
# DEPLOYMENTFOLDERS_END #
# Additional import path used to resolve QML modules in Creator's code model
# QML_IMPORT_PATH #
QML_IMPORT_PATH =
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
# Installation path
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(../../shared/qtquickapplicationviewer/qtquick2applicationviewer/qtquick2applicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #
include(../../shared/deployment.pri)
qtcAddDeployment()
#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/app/main.qml")); // MAINQML
viewer.showExpanded();
return app.exec();
}
import QtQuick 2.1
Rectangle {
width: 360
height: 360
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="C"
featuresRequired="QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2"
viewerdir="qtquick2applicationviewer"
viewerclassname="QtQuick2ApplicationViewer"
stubversionminor="5">
<displayname>Qt Quick 2.1</displayname>
<description>Creates a deployable Qt Quick 2 application using the QtQuick 2.1 import. Requires Qt 5.1 or newer.</description>
</template>
# Add more folders to ship with the application, here
# DEPLOYMENTFOLDERS #
folder_01.source = qml/app
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
# DEPLOYMENTFOLDERS_END #
# Additional import path used to resolve QML modules in Creator's code model
# QML_IMPORT_PATH #
QML_IMPORT_PATH =
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
# Installation path
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(../../shared/qtquickapplicationviewer/qtquick2applicationviewer/qtquick2applicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #
include(../../shared/deployment.pri)
qtcAddDeployment()
#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/app/main.qml")); // MAINQML
viewer.showExpanded();
return app.exec();
}
import QtQuick 2.2
Rectangle {
width: 360
height: 360
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="A"
featuresRequired="QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2"
viewerdir="qtquick2applicationviewer"
viewerclassname="QtQuick2ApplicationViewer"
stubversionminor="5">
<displayname>Qt Quick 2.2</displayname>
<description>Creates a deployable Qt Quick 2 application using the QtQuick 2.2 import. Requires Qt 5.2 or newer.</description>
</template>
......@@ -16,7 +16,7 @@ SOURCES += main.cpp
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(qtquick2controlsapplicationviewer/qtquick2controlsapplicationviewer.pri)
include(../../shared/qtquickapplicationviewer/qtquick2controlsapplicationviewer/qtquick2controlsapplicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #
include(../../shared/deployment.pri)
qtcAddDeployment()
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="B"
<template openeditor="main.qml" priority="D"
featuresRequired="QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2, QtSupport.Wizards.FeatureQtQuick.Controls"
viewerdir="qtquick2controlsapplicationviewer"
viewerclassname="QtQuick2ControlsApplicationViewer"
......
# Add more folders to ship with the application, here
# DEPLOYMENTFOLDERS #
folder_01.source = qml/app
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
# DEPLOYMENTFOLDERS_END #
# Additional import path used to resolve QML modules in Creator's code model
# QML_IMPORT_PATH #
QML_IMPORT_PATH =
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
# Installation path
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(../../shared/qtquickapplicationviewer/qtquick2controlsapplicationviewer/qtquick2controlsapplicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #
include(../../shared/deployment.pri)
qtcAddDeployment()
#include "qtquick2controlsapplicationviewer.h"
int main(int argc, char *argv[])
{
Application app(argc, argv);
QtQuick2ControlsApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/app/main.qml")); // MAINQML
viewer.show();
return app.exec();
}
import QtQuick 2.2
import QtQuick.Controls 1.1
ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
Button {
text: qsTr("Hello World")
anchors.centerIn: parent
}
}
<?xml version="1.0" encoding="UTF-8"?>
<template openeditor="main.qml" priority="B"
featuresRequired="QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2, QtSupport.Wizards.FeatureQtQuick.Controls"
viewerdir="qtquick2controlsapplicationviewer"
viewerclassname="QtQuick2ControlsApplicationViewer"
stubversionminor="1">
<displayname>Qt Quick Controls 1.1</displayname>
<description>Creates a deployable Qt Quick 2 application using Qt Quick Controls. Requires Qt 5.2 or newer.</description>
</template>
......@@ -121,6 +121,7 @@ public:
static const QString DeploymentPriFileName;
protected:
AbstractMobileApp();
virtual QByteArray generateProFile(QString *errorMessage) const;
static QString templatesRoot();
static void insertParameter(QString &line, const QString &parameter);
......@@ -146,7 +147,6 @@ protected:
private:
QByteArray generateDesktopFile(QString *errorMessage, int fileType) const;
QByteArray generateMainCpp(QString *errorMessage) const;
QByteArray generateProFile(QString *errorMessage) const;
virtual QByteArray generateFileExtended(int fileType,
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const = 0;
......
......@@ -44,6 +44,11 @@
namespace QmakeProjectManager {
namespace Internal {
static QString qtQuickApplicationViewerDirectory()
{
return Core::ICore::resourcePath() + QLatin1String("/templates/shared/qtquickapplicationviewer/");
}
static QString templateRootDirectory()
{
return Core::ICore::resourcePath() + QLatin1String("/templates/qtquick/");
......@@ -208,11 +213,11 @@ QString QtQuickApp::pathExtended(int fileType) const
case MainQmlDeployed: return qmlSubDir + mainQmlFile;
case MainQmlOrigin: return qmlOriginDir + mainQmlFile;
case AppViewerPri: return pathBase + appViewerTargetSubDir + fileName(AppViewerPri);
case AppViewerPriOrigin: return originsRoot() + appViewerOriginSubDir() + fileName(AppViewerPri);
case AppViewerPriOrigin: return qtQuickApplicationViewerDirectory() + appViewerOriginSubDir() + fileName(AppViewerPri);
case AppViewerCpp: return pathBase + appViewerTargetSubDir + fileName(AppViewerCpp);
case AppViewerCppOrigin: return originsRoot() + appViewerOriginSubDir() + fileName(AppViewerCpp);
case AppViewerCppOrigin: return qtQuickApplicationViewerDirectory() + appViewerOriginSubDir() + fileName(AppViewerCpp);
case AppViewerH: return pathBase + appViewerTargetSubDir + fileName(AppViewerH);
case AppViewerHOrigin: return originsRoot() + appViewerOriginSubDir() + fileName(AppViewerH);
case AppViewerHOrigin: return qtQuickApplicationViewerDirectory() + appViewerOriginSubDir() + fileName(AppViewerH);
case QmlDirProFileRelative: return QString(qmlSubDir).remove(qmlSubDir.length() - 1, 1);
default: qFatal("QtQuickApp::pathExtended() needs more work");
}
......@@ -294,6 +299,13 @@ QString QtQuickApp::appViewerOriginSubDir() const
return appViewerBaseName() + QLatin1Char('/');
}
QByteArray QtQuickApp::generateProFile(QString *errorMessage) const
{
QByteArray proFileContent = AbstractMobileApp::generateProFile(errorMessage);
proFileContent.replace("../../shared/qtquickapplicationviewer/", "");
return proFileContent;
}
QByteArray QtQuickApp::generateFileExtended(int fileType,
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const
{
......
......@@ -95,7 +95,9 @@ public:
static const int StubVersion;
protected:
virtual QString appViewerBaseName() const;
virtual QByteArray generateProFile(QString *errorMessage) const;
QString appViewerBaseName() const;
QString fileName(ExtendedFileType type) const;
QString appViewerOriginSubDir() const;
......
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