diff options
author | Venu <venugopal.shivashankar@digia.com> | 2014-10-07 16:16:13 +0200 |
---|---|---|
committer | Venugopal Shivashankar <venugopal.shivashankar@digia.com> | 2014-10-23 10:49:04 +0200 |
commit | 0c8bb607e1371b301650029a3e5dfe4641cc2f98 (patch) | |
tree | 1528a8d4bc8e7f493cfbf18a069edda672171481 /src/qml/doc/src/cppintegration | |
parent | 40a6845bcce22aca96e1dee26360bdff3e9520fb (diff) |
Doc: Fixed an error in the QML snippet
Also updated the C++ snippet to look like a
gui app that shows the QML example, instead of
a console app that just provides the context data
to the QML example.
Change-Id: I17aca9f03521cfcadba1a965a4924e87cbf14c62
Task-number: QTBUG-41699
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/qml/doc/src/cppintegration')
-rw-r--r-- | src/qml/doc/src/cppintegration/exposecppattributes.qdoc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc index 9527229204..d8e05b4358 100644 --- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc +++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc @@ -398,13 +398,13 @@ methods, as shown below right: \li \code int main(int argc, char *argv[]) { - QCoreApplication app(argc, argv); + QGuiApplication app(argc, argv); - QQmlEngine engine; - Message msg; - engine.rootContext()->setContextProperty("msg", &msg); - QQmlComponent component(&engine, QUrl::fromLocalFile("MyItem.qml")); - component.create(); + MessageBoard msgBoard; + QQuickView view; + view.engine()->rootContext()->setContextProperty("msgBoard", &msgBoard); + view.setSource(QUrl::fromLocalFile("MyItem.qml")); + view.show(); return app.exec(); } |