diff options
Diffstat (limited to 'examples/declarative/modelviews/stringlistmodel/main.cpp')
-rw-r--r-- | examples/declarative/modelviews/stringlistmodel/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/declarative/modelviews/stringlistmodel/main.cpp b/examples/declarative/modelviews/stringlistmodel/main.cpp index b2ebd4b..ea73859 100644 --- a/examples/declarative/modelviews/stringlistmodel/main.cpp +++ b/examples/declarative/modelviews/stringlistmodel/main.cpp @@ -56,19 +56,20 @@ int main(int argc, char ** argv) { QApplication app(argc, argv); - QDeclarativeView view; - +//![0] QStringList dataList; dataList.append("Item 1"); dataList.append("Item 2"); dataList.append("Item 3"); dataList.append("Item 4"); + QDeclarativeView view; QDeclarativeContext *ctxt = view.rootContext(); ctxt->setContextProperty("myModel", QVariant::fromValue(dataList)); view.setSource(QUrl("qrc:view.qml")); view.show(); +//![0] return app.exec(); } |