1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #include "qtquickapp.h"
37 using namespace Qt4ProjectManager::Internal;
39 int main(int argc, char *argv[])
43 const QString projectPath = QLatin1String("testprojects");
47 sAppNew.setProjectPath(projectPath);
48 sAppNew.setProjectName(QLatin1String("new_qml_app"));
49 if (!sAppNew.generateFiles(&errorMessage))
54 QtQuickApp sAppImport01;
55 sAppImport01.setProjectPath(projectPath);
56 sAppImport01.setProjectName(QLatin1String("qml_imported_scenario_01"));
57 sAppImport01.setMainQml(QtQuickApp::ModeImport, QLatin1String("../appwizards/qmlimportscenario_01/myqmlapp.qml"));
58 if (!sAppImport01.generateFiles(&errorMessage))
63 const QString rootPath = QLatin1String("../appwizards/qmlimportscenario_02/");
64 QtQuickApp sAppImport02;
65 sAppImport02.setProjectPath(projectPath);
66 sAppImport02.setProjectName(QLatin1String("qml_imported_scenario_02"));
67 sAppImport02.setMainQml(QtQuickApp::ModeImport, rootPath + QLatin1String("subfolder1/myqmlapp.qml"));
68 QStringList moduleNames;
69 moduleNames.append(QLatin1String("no.trolltech.QmlModule01"));
70 moduleNames.append(QLatin1String("com.nokia.QmlModule02"));
71 QStringList importPaths;
72 importPaths.append(rootPath + QLatin1String("subfolder2/"));
73 importPaths.append(rootPath + QLatin1String("subfolder3/"));
74 if (!sAppImport02.setExternalModules(moduleNames, importPaths)) {
75 qDebug() << sAppImport02.error();
78 if (!sAppImport02.generateFiles(&errorMessage))
84 sAppNew.setProjectPath(projectPath);
85 sAppNew.setProjectName(QLatin1String("new_html5_app"));
86 qDebug() << sAppNew.path(Html5App::MainHtml);
87 if (!sAppNew.generateFiles(&errorMessage))
93 sAppNew.setProjectPath(projectPath);
94 sAppNew.setProjectName(QLatin1String("html5_imported_scenario_01"));
95 sAppNew.setMainHtml(Html5App::ModeImport, QLatin1String("../appwizards/htmlimportscenario_01/themainhtml.html"));
96 sAppNew.setTouchOptimizedNavigationEnabled(true);
97 qDebug() << sAppNew.path(Html5App::MainHtml);
98 if (!sAppNew.generateFiles(&errorMessage))
104 sAppNew.setProjectPath(projectPath);
105 sAppNew.setProjectName(QLatin1String("html5_url"));
106 sAppNew.setMainHtml(Html5App::ModeUrl, QLatin1String("http://www.jqtouch.com/preview/demos/main/"));
107 qDebug() << sAppNew.path(Html5App::MainHtml);
108 if (!sAppNew.generateFiles(&errorMessage))