summaryrefslogtreecommitdiffstats
path: root/examples/declarative/modelviews/objectlistmodel/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/modelviews/objectlistmodel/main.cpp')
-rw-r--r--examples/declarative/modelviews/objectlistmodel/main.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/declarative/modelviews/objectlistmodel/main.cpp b/examples/declarative/modelviews/objectlistmodel/main.cpp
index 8c921b7..89c22a1 100644
--- a/examples/declarative/modelviews/objectlistmodel/main.cpp
+++ b/examples/declarative/modelviews/objectlistmodel/main.cpp
@@ -56,10 +56,8 @@
//![0]
int main(int argc, char ** argv)
{
-//![0]
QApplication app(argc, argv);
-//![1]
QList<QObject*> dataList;
dataList.append(new DataObject("Item 1", "red"));
dataList.append(new DataObject("Item 2", "green"));
@@ -69,13 +67,11 @@ int main(int argc, char ** argv)
QDeclarativeView view;
QDeclarativeContext *ctxt = view.rootContext();
ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+//![0]
view.setSource(QUrl("qrc:view.qml"));
view.show();
-//![1]
return app.exec();
-//![2]
}
-//![2]