| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  | /**************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-01-26 18:33:46 +01:00
										 |  |  | ** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-11-02 15:59:12 +01:00
										 |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU Lesser General Public License Usage | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** This file may be used under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  | ** License version 2.1 as published by the Free Software Foundation and | 
					
						
							|  |  |  | ** appearing in the file LICENSE.LGPL included in the packaging of this file. | 
					
						
							|  |  |  | ** Please review the following information to ensure the GNU Lesser General | 
					
						
							|  |  |  | ** Public License version 2.1 requirements will be met: | 
					
						
							|  |  |  | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** In addition, as a special exception, Nokia gives you certain additional | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** rights. These rights are described in the Nokia Qt LGPL Exception | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-04-13 08:42:33 +02:00
										 |  |  | ** Other Usage | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Alternatively, this file may be used in accordance with the terms and | 
					
						
							|  |  |  | ** conditions contained in a signed written agreement between you and Nokia. | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** If you have questions regarding the use of this file, please contact | 
					
						
							| 
									
										
										
										
											2011-11-02 15:59:12 +01:00
										 |  |  | ** Nokia at qt-info@nokia.com. | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | **************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-06 16:23:02 +01:00
										 |  |  | #include "qtquickapp.h"
 | 
					
						
							| 
									
										
										
										
											2011-02-05 23:08:59 +01:00
										 |  |  | #include "html5app.h"
 | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  | #include <QtCore>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace Qt4ProjectManager::Internal; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int main(int argc, char *argv[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     QString errorMessage; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const QString projectPath = QLatin1String("testprojects"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-02-06 16:23:02 +01:00
										 |  |  |         QtQuickApp sAppNew; | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  |         sAppNew.setProjectPath(projectPath); | 
					
						
							|  |  |  |         sAppNew.setProjectName(QLatin1String("new_qml_app")); | 
					
						
							|  |  |  |         if (!sAppNew.generateFiles(&errorMessage)) | 
					
						
							|  |  |  |            return 1; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-02-06 16:23:02 +01:00
										 |  |  |         QtQuickApp sAppImport01; | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  |         sAppImport01.setProjectPath(projectPath); | 
					
						
							| 
									
										
										
										
											2011-02-08 20:54:51 +01:00
										 |  |  |         sAppImport01.setProjectName(QLatin1String("qml_imported_scenario_01")); | 
					
						
							| 
									
										
										
										
											2011-02-09 21:39:46 +01:00
										 |  |  |         sAppImport01.setMainQml(QtQuickApp::ModeImport, QLatin1String("../appwizards/qmlimportscenario_01/myqmlapp.qml")); | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  |         if (!sAppImport01.generateFiles(&errorMessage)) | 
					
						
							|  |  |  |             return 1; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-01-27 17:05:40 +01:00
										 |  |  |         const QString rootPath = QLatin1String("../appwizards/qmlimportscenario_02/"); | 
					
						
							| 
									
										
										
										
											2011-02-06 16:23:02 +01:00
										 |  |  |         QtQuickApp sAppImport02; | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  |         sAppImport02.setProjectPath(projectPath); | 
					
						
							| 
									
										
										
										
											2011-02-08 20:54:51 +01:00
										 |  |  |         sAppImport02.setProjectName(QLatin1String("qml_imported_scenario_02")); | 
					
						
							| 
									
										
										
										
											2011-02-09 21:39:46 +01:00
										 |  |  |         sAppImport02.setMainQml(QtQuickApp::ModeImport, rootPath + QLatin1String("subfolder1/myqmlapp.qml")); | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  |         QStringList moduleNames; | 
					
						
							|  |  |  |         moduleNames.append(QLatin1String("no.trolltech.QmlModule01")); | 
					
						
							|  |  |  |         moduleNames.append(QLatin1String("com.nokia.QmlModule02")); | 
					
						
							|  |  |  |         QStringList importPaths; | 
					
						
							|  |  |  |         importPaths.append(rootPath + QLatin1String("subfolder2/")); | 
					
						
							|  |  |  |         importPaths.append(rootPath + QLatin1String("subfolder3/")); | 
					
						
							|  |  |  |         if (!sAppImport02.setExternalModules(moduleNames, importPaths)) { | 
					
						
							|  |  |  |             qDebug() << sAppImport02.error(); | 
					
						
							|  |  |  |             return 2; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (!sAppImport02.generateFiles(&errorMessage)) | 
					
						
							|  |  |  |             return 1; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-05 23:08:59 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         Html5App sAppNew; | 
					
						
							|  |  |  |         sAppNew.setProjectPath(projectPath); | 
					
						
							|  |  |  |         sAppNew.setProjectName(QLatin1String("new_html5_app")); | 
					
						
							| 
									
										
										
										
											2011-02-09 16:23:35 +01:00
										 |  |  |         qDebug() << sAppNew.path(Html5App::MainHtml); | 
					
						
							|  |  |  |         if (!sAppNew.generateFiles(&errorMessage)) | 
					
						
							|  |  |  |            return 1; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Html5App sAppNew; | 
					
						
							|  |  |  |         sAppNew.setProjectPath(projectPath); | 
					
						
							|  |  |  |         sAppNew.setProjectName(QLatin1String("html5_imported_scenario_01")); | 
					
						
							|  |  |  |         sAppNew.setMainHtml(Html5App::ModeImport, QLatin1String("../appwizards/htmlimportscenario_01/themainhtml.html")); | 
					
						
							| 
									
										
										
										
											2011-03-18 17:14:53 +01:00
										 |  |  |         sAppNew.setTouchOptimizedNavigationEnabled(true); | 
					
						
							| 
									
										
										
										
											2011-02-09 16:23:35 +01:00
										 |  |  |         qDebug() << sAppNew.path(Html5App::MainHtml); | 
					
						
							|  |  |  |         if (!sAppNew.generateFiles(&errorMessage)) | 
					
						
							|  |  |  |            return 1; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Html5App sAppNew; | 
					
						
							|  |  |  |         sAppNew.setProjectPath(projectPath); | 
					
						
							|  |  |  |         sAppNew.setProjectName(QLatin1String("html5_url")); | 
					
						
							|  |  |  |         sAppNew.setMainHtml(Html5App::ModeUrl, QLatin1String("http://www.jqtouch.com/preview/demos/main/")); | 
					
						
							|  |  |  |         qDebug() << sAppNew.path(Html5App::MainHtml); | 
					
						
							| 
									
										
										
										
											2011-02-05 23:08:59 +01:00
										 |  |  |         if (!sAppNew.generateFiles(&errorMessage)) | 
					
						
							|  |  |  |            return 1; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-13 18:29:46 +02:00
										 |  |  |     return 0; | 
					
						
							|  |  |  | } |