aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-11-12 12:11:29 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-11-12 11:38:18 +0000
commit54d4f8f526f9c9a1af702b14925e1d34ee8b2134 (patch)
tree0a95203ab3c9fadae4d20f6aa497a58a5dfe819a /src/quick/doc/snippets
parentc6452857a96d24325906ebd5529cfdda916a68fc (diff)
QQuickView docs: show correct usage of setInitialProperties
Pick-to: 5.15 Change-Id: If63f4c59f18bc0754ce2e68e424f6efd0f512d30 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/doc/snippets')
-rw-r--r--src/quick/doc/snippets/qquickview-ex.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/qquickview-ex.cpp b/src/quick/doc/snippets/qquickview-ex.cpp
index 32406f8f2f..5f93dfdbe8 100644
--- a/src/quick/doc/snippets/qquickview-ex.cpp
+++ b/src/quick/doc/snippets/qquickview-ex.cpp
@@ -59,3 +59,12 @@ int main(int argc, char *argv[])
return app.exec();
}
//![0]
+
+void makeDocTeamHappyByKeepingExampleCompilable() {
+//![1]
+ QScopedPointer<QQuickView> view { new QQuickView };
+ view->setInitialProperties({"x, 100"}, {"width", 50});
+ view->setSource(QUrl::fromLocalFile("myqmlfile.qml"));
+ view->show();
+//![1]
+}