diff options
Diffstat (limited to 'examples/declarative/modelviews/abstractitemmodel/main.cpp')
-rw-r--r-- | examples/declarative/modelviews/abstractitemmodel/main.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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(); } |