summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorartoka <arto.katajasalo@digia.com>2011-11-17 14:49:53 (GMT)
committerCasper van Donderen <casper.vandonderen@nokia.com>2011-11-17 14:58:48 (GMT)
commitf65bf7667c8ac651f54c81e78a3122acd649ffdd (patch)
tree9ff35dd4cd2d21a830560fa6fe00c5fff5a68d5c /examples/declarative
parentdb1f439f1760abe1df85834d5d5adb3575c90c93 (diff)
downloadQt-f65bf7667c8ac651f54c81e78a3122acd649ffdd.zip
Qt-f65bf7667c8ac651f54c81e78a3122acd649ffdd.tar.gz
Qt-f65bf7667c8ac651f54c81e78a3122acd649ffdd.tar.bz2
modelviews/stringlistmodel example modifications
Modified the example to use centralized qmlapplicationviewer, removed duplicate files and modified project files according to the changes. Merge-request: 2719 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/modelviews/stringlistmodel/main.cpp16
-rw-r--r--examples/declarative/modelviews/stringlistmodel/qml/stringlistmodel/view.qml (renamed from examples/declarative/modelviews/stringlistmodel/view.qml)0
-rw-r--r--examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro46
3 files changed, 43 insertions, 19 deletions
diff --git a/examples/declarative/modelviews/stringlistmodel/main.cpp b/examples/declarative/modelviews/stringlistmodel/main.cpp
index b3452ba..4d6c4d1 100644
--- a/examples/declarative/modelviews/stringlistmodel/main.cpp
+++ b/examples/declarative/modelviews/stringlistmodel/main.cpp
@@ -38,14 +38,9 @@
**
****************************************************************************/
+#include "qmlapplicationviewer.h"
#include <QApplication>
-
-#include <qdeclarativeengine.h>
#include <qdeclarativecontext.h>
-#include <qdeclarative.h>
-#include <qdeclarativeitem.h>
-#include <qdeclarativeview.h>
-
/*
This example illustrates exposing a QStringList as a
@@ -55,6 +50,7 @@
int main(int argc, char ** argv)
{
QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
//![0]
QStringList dataList;
@@ -63,13 +59,13 @@ int main(int argc, char ** argv)
dataList.append("Item 3");
dataList.append("Item 4");
- QDeclarativeView view;
- QDeclarativeContext *ctxt = view.rootContext();
+ QDeclarativeContext *ctxt = viewer.rootContext();
ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
//![0]
- view.setSource(QUrl("qrc:view.qml"));
- view.show();
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/stringlistmodel/view.qml"));
+ viewer.showExpanded();
return app.exec();
}
diff --git a/examples/declarative/modelviews/stringlistmodel/view.qml b/examples/declarative/modelviews/stringlistmodel/qml/stringlistmodel/view.qml
index 9c65d80..9c65d80 100644
--- a/examples/declarative/modelviews/stringlistmodel/view.qml
+++ b/examples/declarative/modelviews/stringlistmodel/qml/stringlistmodel/view.qml
diff --git a/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro
index 23dc481..463e870 100644
--- a/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro
+++ b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro
@@ -1,9 +1,37 @@
-TEMPLATE = app
-TARGET = stringlistmodel
-DEPENDPATH += .
-INCLUDEPATH += .
-QT += declarative
-
-# Input
-SOURCES += main.cpp
-RESOURCES += stringlistmodel.qrc
+# Add more folders to ship with the application, here
+folder_01.source = qml/stringlistmodel
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE1CB8EBB
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# If your application uses the Qt Mobility libraries, uncomment the following
+# lines and add the respective components to the MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
+# CONFIG += qdeclarative-boostable
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(../../../tools/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()