Skip to content
Snippets Groups Projects
Commit f096b53b authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Fixing the generation of Qt Quick examples

parent 8eb60c65
No related branches found
No related tags found
No related merge requests found
...@@ -28,14 +28,12 @@ bool processXmlFile(const QString &xmlFile) ...@@ -28,14 +28,12 @@ bool processXmlFile(const QString &xmlFile)
case QXmlStreamReader::StartElement: case QXmlStreamReader::StartElement:
if (reader.name() == tag_app) { if (reader.name() == tag_app) {
QmlStandaloneApp qmlApp; QmlStandaloneApp qmlApp;
if (!reader.attributes().hasAttribute(attrib_projectName)) { QFileInfo projectPath;
qDebug() << "Error: Project without name"; if (!reader.attributes().hasAttribute(attrib_projectPath)) {
qDebug() << "Project without path found";
continue; continue;
} }
qmlApp.setProjectName(reader.attributes().value(attrib_projectName).toString()); projectPath = qtDir + reader.attributes().value(attrib_projectPath).toString();
QFileInfo projectPath;
if (reader.attributes().hasAttribute(attrib_projectPath))
projectPath = qtDir + reader.attributes().value(attrib_projectPath).toString();
qmlApp.setProjectPath(projectPath.absoluteFilePath()); qmlApp.setProjectPath(projectPath.absoluteFilePath());
if (reader.attributes().hasAttribute(attrib_mainQmlFile)) { if (reader.attributes().hasAttribute(attrib_mainQmlFile)) {
const QFileInfo qmlFileOrigin( const QFileInfo qmlFileOrigin(
...@@ -46,8 +44,8 @@ bool processXmlFile(const QString &xmlFile) ...@@ -46,8 +44,8 @@ bool processXmlFile(const QString &xmlFile)
continue; continue;
} }
const QFileInfo qmlTargetPath(QString(projectPath.absoluteFilePath() const QFileInfo qmlTargetPath(QString(projectPath.absoluteFilePath()
+ QLatin1Char('/') + qmlApp.projectName() + QLatin1Char('/') + qmlFileOrigin.baseName()
+ QLatin1String("/qml/") + qmlApp.projectName())); + QLatin1String("/qml")));
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
const QString sourcePath = const QString sourcePath =
QDir::toNativeSeparators(qmlFileOrigin.canonicalPath() + QLatin1String("/*")); QDir::toNativeSeparators(qmlFileOrigin.canonicalPath() + QLatin1String("/*"));
...@@ -68,6 +66,9 @@ bool processXmlFile(const QString &xmlFile) ...@@ -68,6 +66,9 @@ bool processXmlFile(const QString &xmlFile)
qmlApp.setMainQmlFile(qmlTargetPath.absoluteFilePath() qmlApp.setMainQmlFile(qmlTargetPath.absoluteFilePath()
+ QLatin1Char('/') + qmlFileOrigin.fileName()); + QLatin1Char('/') + qmlFileOrigin.fileName());
} }
qmlApp.setProjectName(reader.attributes().hasAttribute(attrib_projectName)
? reader.attributes().value(attrib_projectName).toString()
: QFileInfo(qmlApp.mainQmlFile()).baseName());
if (reader.attributes().hasAttribute(attrib_screenOrientation)) { if (reader.attributes().hasAttribute(attrib_screenOrientation)) {
const QStringRef orientation = reader.attributes().value(attrib_screenOrientation); const QStringRef orientation = reader.attributes().value(attrib_screenOrientation);
qmlApp.setOrientation(orientation == value_screenOrientationLockLandscape ? qmlApp.setOrientation(orientation == value_screenOrientationLockLandscape ?
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<qmlapps> <qmlapps>
<app <app
mainqmlfile="examples/declarative/animation/basics/property-animation.qml" mainqmlfile="examples/declarative/animation/basics/property-animation.qml"
projectpath="../examples/declarative/animation/basics" projectpath="../examples/declarative/animation/basics"
projectname="propertyanimation" />
/> <app
<app mainqmlfile="examples/declarative/animation/basics/color-animation.qml"
mainqmlfile="examples/declarative/animation/basics/color-animation.qml" projectpath="../examples/declarative/animation/basics"
projectpath="../examples/declarative/animation/basics" />
projectname="coloranimation" <app
/> mainqmlfile="examples/declarative/animation/behaviors/behavior-example.qml"
<app projectpath="../examples/declarative/animation/behaviors"
mainqmlfile="examples/declarative/animation/behaviors/behavior-example.qml" />
projectpath="../examples/declarative/animation/behaviors" <app
projectname="behaviorExample" mainqmlfile="examples/declarative/animation/easing/easing.qml"
/> projectpath="../examples/declarative/animation"
<app screenorientation="LockLandscape"
mainqmlfile="examples/declarative/animation/easing/easing.qml" />
projectpath="../examples/declarative/animation/easing" <app
projectname="easing" mainqmlfile="examples/declarative/animation/states/states.qml"
screenorientation="LockLandscape" projectpath="../examples/declarative/animation"
/> />
<app <app
mainqmlfile="examples/declarative/animation/states/states.qml" mainqmlfile="examples/declarative/imageelements/borderimage/borderimage.qml"
projectpath="../examples/declarative/animation/states" projectpath="../examples/declarative/imageelements"
projectname="states" screenorientation="LockLandscape"
/> />
<app <app
mainqmlfile="examples/declarative/imageelements/borderimage/borderimage.qml" mainqmlfile="examples/declarative/imageelements/borderimage/shadows.qml"
projectpath="../examples/declarative/imageelements" projectpath="../examples/declarative/imageelements"
projectname="borderimage" screenorientation="LockLandscape"
screenorientation="LockLandscape" />
/> <app
<app mainqmlfile="examples/declarative/imageelements/image/image.qml"
mainqmlfile="examples/declarative/imageelements/borderimage/shadows.qml" projectpath="../examples/declarative/imageelements"
projectpath="../examples/declarative/imageelements" screenorientation="LockLandscape"
projectname="shadows" />
screenorientation="LockLandscape" <app
/> mainqmlfile="examples/declarative/text/fonts/availableFonts.qml"
<app projectpath="../examples/declarative/text/fonts"
mainqmlfile="examples/declarative/imageelements/image/image.qml" screenorientation="LockLandscape"
projectpath="../examples/declarative/imageelements" />
projectname="image" <app
screenorientation="LockLandscape" mainqmlfile="examples/declarative/text/fonts/banner.qml"
/> projectpath="../examples/declarative/text/fonts"
<app screenorientation="LockLandscape"
mainqmlfile="examples/declarative/text/fonts/availableFonts.qml" />
projectpath="../examples/declarative/text/fonts/" <app
projectname="availableFonts" mainqmlfile="examples/declarative/text/fonts/fonts.qml"
screenorientation="LockLandscape" projectpath="../examples/declarative/text/fonts/"
/> screenorientation="LockLandscape"
<app />
mainqmlfile="examples/declarative/text/fonts/banner.qml" <app
projectpath="../examples/declarative/text/fonts/" mainqmlfile="examples/declarative/text/fonts/hello.qml"
projectname="banner" projectpath="../examples/declarative/text/fonts/"
screenorientation="LockLandscape" screenorientation="LockLandscape"
/> />
<app <app
mainqmlfile="examples/declarative/text/fonts/fonts.qml" mainqmlfile="examples/declarative/text/textselection/textselection.qml"
projectpath="../examples/declarative/text/fonts/" projectpath="../examples/declarative/text"
projectname="fonts" />
screenorientation="LockLandscape" <app
/> mainqmlfile="examples/declarative/positioners/positioners.qml"
<app projectpath="../examples/declarative"
mainqmlfile="examples/declarative/text/fonts/hello.qml" />
projectpath="../examples/declarative/text/fonts/" <app
projectname="hello" mainqmlfile="examples/declarative/keyinteraction/focus/focus.qml"
screenorientation="LockLandscape" projectpath="../examples/declarative/keyinteraction"
/> screenorientation="LockLandscape"
<app />
mainqmlfile="examples/declarative/text/textselection/textselection.qml" <app
projectpath="../examples/declarative/text/textselection" mainqmlfile="examples/declarative/touchinteraction/gestures/experimental-gestures.qml"
projectname="textselection" projectpath="../examples/declarative/touchinteraction/gestures"
/> />
<app <app
mainqmlfile="examples/declarative/positioners/positioners.qml" mainqmlfile="examples/declarative/touchinteraction/mousearea/mousearea-example.qml"
projectpath="../examples/declarative/positioners" projectpath="../examples/declarative/touchinteraction/mousearea"
projectname="positioners" screenorientation="LockLandscape"
/> />
<app <app
mainqmlfile="examples/declarative/keyinteraction/focus/focus.qml" mainqmlfile="examples/declarative/ui-components/dialcontrol/dialcontrol.qml"
projectpath="../examples/declarative/keyinteraction" projectpath="../examples/declarative/ui-components"
projectname="focus" />
screenorientation="LockLandscape" <app
/> mainqmlfile="examples/declarative/ui-components/flipable/flipable.qml"
<app projectpath="../examples/declarative/ui-components"
mainqmlfile="examples/declarative/touchinteraction/gestures/experimental-gestures.qml" />
projectpath="../examples/declarative/touchinteraction" <app
projectname="gestures" mainqmlfile="examples/declarative/ui-components/progressbar/main.qml"
/> projectpath="../examples/declarative/ui-components"
<app projectname="progressbar"
mainqmlfile="examples/declarative/touchinteraction/mousearea/mousearea-example.qml" />
projectpath="../examples/declarative/touchinteraction" <app
projectname="mousearea" mainqmlfile="examples/declarative/ui-components/scrollbar/main.qml"
screenorientation="LockLandscape" projectpath="../examples/declarative/ui-components"
/> />
<app <app
mainqmlfile="examples/declarative/ui-components/dialcontrol/dialcontrol.qml" mainqmlfile="examples/declarative/ui-components/searchbox/main.qml"
projectpath="../examples/declarative/ui-components" projectpath="../examples/declarative/ui-components"
projectname="dialcontrol" />
/> <app
<app mainqmlfile="examples/declarative/ui-components/slideswitch/slideswitch.qml"
mainqmlfile="examples/declarative/ui-components/flipable/flipable.qml" projectpath="../examples/declarative/ui-components"
projectpath="../examples/declarative/ui-components" screenorientation="LockLandscape"
projectname="flipable" />
/> <app
<app mainqmlfile="examples/declarative/ui-components/spinner/main.qml"
mainqmlfile="examples/declarative/ui-components/progressbar/main.qml" projectpath="../examples/declarative/ui-components"
projectpath="../examples/declarative/ui-components" screenorientation="LockPortrait"
projectname="progressbar" />
/> <app
<app mainqmlfile="examples/declarative/ui-components/tabwidget/main.qml"
mainqmlfile="examples/declarative/ui-components/scrollbar/main.qml" projectpath="../examples/declarative/ui-components"
projectpath="../examples/declarative/ui-components" screenorientation="LockLandscape"
projectname="scrollbar" />
/> <app
<app mainqmlfile="examples/declarative/toys/clocks/clocks.qml"
mainqmlfile="examples/declarative/ui-components/searchbox/main.qml" projectpath="../examples/declarative/toys"
projectpath="../examples/declarative/ui-components" screenorientation="LockLandscape"
projectname="searchbox" />
/> <app
<app mainqmlfile="examples/declarative/toys/corkboards/corkboards.qml"
mainqmlfile="examples/declarative/ui-components/slideswitch/slideswitch.qml" projectpath="../examples/declarative/toys"
projectpath="../examples/declarative/ui-components" screenorientation="LockLandscape"
projectname="slideswitch" />
screenorientation="LockLandscape" <app
/> mainqmlfile="examples/declarative/toys/dynamicscene/dynamicscene.qml"
<app projectpath="../examples/declarative/toys"
mainqmlfile="examples/declarative/ui-components/spinner/main.qml" screenorientation="LockLandscape"
projectpath="../examples/declarative/ui-components" />
projectname="spinner" <app
screenorientation="LockPortrait" mainqmlfile="examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml"
/> projectpath="../examples/declarative/toys/"
<app screenorientation="LockLandscape"
mainqmlfile="examples/declarative/ui-components/tabwidget/main.qml" />
projectpath="../examples/declarative/ui-components" <app
projectname="tabwidget" mainqmlfile="examples/declarative/toys/tvtennis/tvtennis.qml"
screenorientation="LockLandscape" projectpath="../examples/declarative/toys"
/> screenorientation="LockLandscape"
<app />
mainqmlfile="examples/declarative/toys/clocks/clocks.qml" <app
projectpath="../examples/declarative/toys" mainqmlfile="examples/declarative/modelviews/gridview/gridview-example.qml"
projectname="clocks" projectpath="../examples/declarative/modelviews"
screenorientation="LockLandscape" />
/> <app
<app
mainqmlfile="examples/declarative/toys/corkboards/corkboards.qml"
projectpath="../examples/declarative/toys"
projectname="corkboards"
screenorientation="LockLandscape"
/>
<app
mainqmlfile="examples/declarative/toys/dynamicscene/dynamicscene.qml"
projectpath="../examples/declarative/toys"
projectname="dynamicscene"
screenorientation="LockLandscape"
/>
<app
mainqmlfile="examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml"
projectpath="../examples/declarative/toys/"
projectname="tic-tac-toe"
screenorientation="LockLandscape"
/>
<app
mainqmlfile="examples/declarative/toys/tvtennis/tvtennis.qml"
projectpath="../examples/declarative/toys"
projectname="tvtennis"
screenorientation="LockLandscape"
/>
<app
mainqmlfile="examples/declarative/modelviews/gridview/gridview-example.qml"
projectpath="../examples/declarative/modelviews"
projectname="gridview"
/>
<app
mainqmlfile="examples/declarative/modelviews/listview/dynamiclist.qml" mainqmlfile="examples/declarative/modelviews/listview/dynamiclist.qml"
projectpath="../examples/declarative/modelviews/listview" projectpath="../examples/declarative/modelviews/listview"
projectname="dynamiclist"
/> />
<app <app
mainqmlfile="examples/declarative/modelviews/listview/expandingdelegates.qml" mainqmlfile="examples/declarative/modelviews/listview/expandingdelegates.qml"
projectpath="../examples/declarative/modelviews/listview" projectpath="../examples/declarative/modelviews/listview"
projectname="expandingdelegates"
/> />
<app <app
mainqmlfile="examples/declarative/modelviews/listview/highlight.qml" mainqmlfile="examples/declarative/modelviews/listview/highlight.qml"
projectpath="../examples/declarative/modelviews/listview" projectpath="../examples/declarative/modelviews/listview"
projectname="highlight" screenorientation="LockPortrait"
screenorientation="LockPortrait"
/> />
<app <app
mainqmlfile="examples/declarative/modelviews/listview/highlightranges.qml" mainqmlfile="examples/declarative/modelviews/listview/highlightranges.qml"
projectpath="../examples/declarative/modelviews/listview" projectpath="../examples/declarative/modelviews/listview"
projectname="highlightranges" screenorientation="LockLandscape"
screenorientation="LockLandscape"
/> />
<app <app
mainqmlfile="examples/declarative/modelviews/listview/sections.qml" mainqmlfile="examples/declarative/modelviews/listview/sections.qml"
projectpath="../examples/declarative/modelviews/listview" projectpath="../examples/declarative/modelviews/listview"
projectname="sections" screenorientation="LockPortrait"
screenorientation="LockPortrait" />
/> <app
<app mainqmlfile="examples/declarative/modelviews/pathview/pathview-example.qml"
mainqmlfile="examples/declarative/modelviews/pathview/pathview-example.qml" projectpath="../examples/declarative/modelviews"
projectpath="../examples/declarative/modelviews" screenorientation="LockLandscape"
projectname="pathview" />
screenorientation="LockLandscape" <app
/> mainqmlfile="examples/declarative/modelviews/package/Delegate.qml"
<app projectpath="../examples/declarative/modelviews"
mainqmlfile="examples/declarative/modelviews/package/Delegate.qml" screenorientation="LockLandscape"
projectpath="../examples/declarative/modelviews" />
projectname="package" <app
screenorientation="LockLandscape" mainqmlfile="examples/declarative/modelviews/parallax/parallax.qml"
/> projectpath="../examples/declarative/modelviews"
<app screenorientation="LockLandscape"
mainqmlfile="examples/declarative/modelviews/parallax/parallax.qml" />
projectpath="../examples/declarative/modelviews" <app
projectname="parallax" mainqmlfile="examples/declarative/modelviews/visualitemmodel/visualitemmodel.qml"
screenorientation="LockLandscape" projectpath="../examples/declarative/modelviews"
/> />
<app <app
mainqmlfile="examples/declarative/modelviews/visualitemmodel/visualitemmodel.qml" mainqmlfile="examples/declarative/modelviews/webview/alerts.qml"
projectpath="../examples/declarative/modelviews" projectpath="../examples/declarative/modelviews/webview"
projectname="visualitemmodel" networkaccess="true"
/> />
<app <app
mainqmlfile="examples/declarative/modelviews/stringlistmodel/view.qml" mainqmlfile="examples/declarative/modelviews/webview/autosize.qml"
projectpath="../examples/declarative/modelviews" projectpath="../examples/declarative/modelviews/webview"
projectname="stringlistmodel" screenorientation="LockPortrait"
/> networkaccess="true"
<app />
mainqmlfile="examples/declarative/modelviews/objectlistmodel/view.qml" <app
projectpath="../examples/declarative/modelviews" mainqmlfile="examples/declarative/modelviews/webview/googlemaps.qml"
projectname="objectlistmodel" projectpath="../examples/declarative/modelviews/webview"
/> networkaccess="true"
<app />
mainqmlfile="examples/declarative/modelviews/abstractitemmodel/view.qml" <app
projectpath="../examples/declarative/modelviews" mainqmlfile="examples/declarative/modelviews/webview/inlinehtml.qml"
projectname="abstractitemmodel" projectpath="../examples/declarative/modelviews/webview"
/> networkaccess="true"
<app />
mainqmlfile="examples/declarative/modelviews/webview/alert.qml" <app
projectpath="../examples/declarative/modelviews/webview" mainqmlfile="examples/declarative/modelviews/webview/newwindows.qml"
projectname="alert" projectpath="../examples/declarative/modelviews/webview"
networkaccess="true" networkaccess="true"
/> />
<app <app
mainqmlfile="examples/declarative/modelviews/webview/autosize.qml" mainqmlfile="examples/declarative/xml/xmlhttprequest/xmlhttprequest-example.qml"
projectpath="../examples/declarative/modelviews/webview" projectpath="../examples/declarative/xml"
projectname="autosize" screenorientation="LockLandscape"
screenorientation="LockPortrait" networkaccess="true"
networkaccess="true" />
/> <app
<app mainqmlfile="examples/declarative/i18n/i18n.qml"
mainqmlfile="examples/declarative/modelviews/webview/googlemaps.qml" projectpath="../examples/declarative"
projectpath="../examples/declarative/modelviews/webview" screenorientation="LockLandscape"
projectname="googlemaps" />
networkaccess="true"
/>
<app
mainqmlfile="examples/declarative/modelviews/webview/inlinehtml.qml"
projectpath="../examples/declarative/modelviews/webview"
projectname="inlinehtml"
networkaccess="true"
/>
<app
mainqmlfile="examples/declarative/modelviews/webview/newwindows.qml"
projectpath="../examples/declarative/modelviews/webview"
projectname="newwindows"
networkaccess="true"
/>
<app
mainqmlfile="examples/declarative/xml/xmlhttprequest/xmlhttprequest-example.qml"
projectpath="../examples/declarative/xml"
projectname="xmlhttprequest"
screenorientation="LockLandscape"
networkaccess="true"
/>
<app
mainqmlfile="examples/declarative/i18n/i18n.qml"
projectpath="../examples/declarative"
projectname="i18n"
screenorientation="LockLandscape"
/>
<app
mainqmlfile="examples/declarative/calculator/calculator.qml"
projectpath="../examples/declarative/declarative"
projectname="calculator"
/>
<app
mainqmlfile="demos/declarative/flickr/flickr.qml"
projectpath="../examples/declarative"
projectname="flickr"
screenorientation="LockPortrait"
networkaccess="true"
/>
<app
mainqmlfile="examples/declarative/minehunt/minehunt.qml"
projectpath="../examples/declarative/"
projectname="minehunt"
/>
<app
mainqmlfile="examples/declarative/photoviewer/photoviewer.qml"
projectpath="../examples/declarative/"
projectname="photoviewer"
/>
<app
mainqmlfile="examples/declarative/rssnews/rssnews.qml"
projectpath="../examples/declarative/"
projectname="rssnews"
networkaccess="true"
/>
<app
mainqmlfile="examples/declarative/samegame/samegame.qml"
projectpath="../examples/declarative/"
projectname="samegame"
/>
<app
mainqmlfile="examples/declarative/snake/snake.qml"
projectpath="../examples/declarative/"
projectname="snake"
/>
<app
mainqmlfile="examples/declarative/twitter/twitter.qml"
projectpath="../examples/declarative/"
projectname="twitter"
screenorientation="LockLandscape"
networkaccess="true"
/>
<app
mainqmlfile="examples/declarative/webbrowser/webbrowser.qml"
projectpath="../examples/declarative/"
projectname="webbrowser"
networkaccess="true"
/>
</qmlapps> </qmlapps>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment