summaryrefslogtreecommitdiffstats
path: root/examples/declarative/modelviews/abstractitemmodel
diff options
context:
space:
mode:
authorartoka <arto.katajasalo@digia.com>2011-11-17 14:49:46 (GMT)
committerCasper van Donderen <casper.vandonderen@nokia.com>2011-11-17 14:58:13 (GMT)
commit923f679cb1096d1cb56fbb735a268b5249913480 (patch)
treec82357d5cdac75c8a0fddc1fac2157f32b093794 /examples/declarative/modelviews/abstractitemmodel
parentcdf1f23df6c320177abccc6cda8917d1a24e9fd0 (diff)
downloadQt-923f679cb1096d1cb56fbb735a268b5249913480.zip
Qt-923f679cb1096d1cb56fbb735a268b5249913480.tar.gz
Qt-923f679cb1096d1cb56fbb735a268b5249913480.tar.bz2
modelviews/abstractitemmodel example modifications
Modified the project to use centralized qmlapplicationviewer, deleted duplicate files and modified the project files according to the changes. Merge-request: 2719 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'examples/declarative/modelviews/abstractitemmodel')
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro39
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/main.cpp12
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/qml/abstractitemmodel/view.qml (renamed from examples/declarative/modelviews/abstractitemmodel/view.qml)0
3 files changed, 41 insertions, 10 deletions
diff --git a/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro
index 55e67f3..98490b2 100644
--- a/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro
+++ b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro
@@ -1,8 +1,39 @@
-TEMPLATE = app
+# Add more folders to ship with the application, here
+folder_01.source = qml/abstractitemmodel
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
-QT += declarative
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
-RESOURCES += abstractitemmodel.qrc
+symbian:TARGET.UID3 = 0xE1CB8EBB
-HEADERS = model.h
+# 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 model.cpp
+HEADERS = model.h
+RESOURCES += abstractitemmodel.qrc
+
+# Please do not modify the following two lines. Required for deployment.
+include(../../../tools/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/abstractitemmodel/main.cpp b/examples/declarative/modelviews/abstractitemmodel/main.cpp
index f60c9b8..4a3e84e 100644
--- a/examples/declarative/modelviews/abstractitemmodel/main.cpp
+++ b/examples/declarative/modelviews/abstractitemmodel/main.cpp
@@ -38,28 +38,28 @@
**
****************************************************************************/
#include "model.h"
+#include "qmlapplicationviewer.h"
#include <QDeclarativeContext>
-#include <QDeclarativeView>
-
#include <QApplication>
//![0]
int main(int argc, char ** argv)
{
QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
AnimalModel model;
model.addAnimal(Animal("Wolf", "Medium"));
model.addAnimal(Animal("Polar bear", "Large"));
model.addAnimal(Animal("Quoll", "Small"));
- QDeclarativeView view;
- QDeclarativeContext *ctxt = view.rootContext();
+ QDeclarativeContext *ctxt = viewer.rootContext();
ctxt->setContextProperty("myModel", &model);
//![0]
- view.setSource(QUrl("qrc:view.qml"));
- view.show();
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/abstractitemmodel/view.qml"));
+ viewer.showExpanded();
return app.exec();
}
diff --git a/examples/declarative/modelviews/abstractitemmodel/view.qml b/examples/declarative/modelviews/abstractitemmodel/qml/abstractitemmodel/view.qml
index 0363e9a..0363e9a 100644
--- a/examples/declarative/modelviews/abstractitemmodel/view.qml
+++ b/examples/declarative/modelviews/abstractitemmodel/qml/abstractitemmodel/view.qml