diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-11-12 12:11:29 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-11-12 14:13:52 +0000 |
commit | 4ee1462686dc12eb463f5ba6b378d43a39aed074 (patch) | |
tree | 69f0a771341cf2f92bc86cea43b419586dcf5e4c /src/quick/doc | |
parent | d27e0cc2a41c229c5b4085b2d78c4328a82baecd (diff) |
QQuickView docs: show correct usage of setInitialProperties
Change-Id: If63f4c59f18bc0754ce2e68e424f6efd0f512d30
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 54d4f8f526f9c9a1af702b14925e1d34ee8b2134)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/doc')
-rw-r--r-- | src/quick/doc/snippets/qquickview-ex.cpp | 9 |
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] +} |