aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/cppintegration
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-07-04 15:20:33 +0200
committerLiang Qi <liang.qi@qt.io>2017-07-04 15:22:47 +0200
commit39888db8b34767974d4a443bfe40b9e84fed315a (patch)
tree2133759c6c2e91ff65b886c70093f4f52c7bbba5 /src/qml/doc/src/cppintegration
parentfd295c5047095806db2015a978ed593a140ff373 (diff)
parent5c221826025276aea5ee19275f350a28e02db254 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: .qmake.conf src/quick/doc/src/qmltypereference.qdoc Change-Id: Ia58f1c5a98309c32ef8d8e5c893faf261215f19f
Diffstat (limited to 'src/qml/doc/src/cppintegration')
-rw-r--r--src/qml/doc/src/cppintegration/topic.qdoc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/doc/src/cppintegration/topic.qdoc b/src/qml/doc/src/cppintegration/topic.qdoc
index 22115395b1..183af25297 100644
--- a/src/qml/doc/src/cppintegration/topic.qdoc
+++ b/src/qml/doc/src/cppintegration/topic.qdoc
@@ -46,13 +46,13 @@ BackEnd, in a QML application:
\li Add a new C++ class called \c BackEnd to the project and replace its header
file contents with:
-\quotefile code/backend/backend.h
+\snippet code/backend/backend.h backend_header
The \c Q_PROPERTY macro declares a property that could be accessed from QML.
\li Replace its C++ file contents with:
-\quotefile code/backend/backend.cpp
+\snippet code/backend/backend.cpp backend_cpp
The \c setUserName function emits the \c userNameChanged signal every time
\c m_userName value changes. The signal can be handled from QML using the
@@ -61,14 +61,14 @@ The \c setUserName function emits the \c userNameChanged signal every time
\li Include \c "backend.h" in \c main.cpp and register the class as a QML type
under a import URL as shown below:
-\quotefile code/backend/main.cpp
+\snippet code/backend/main.cpp main_cpp
The BackEnd class is registered as a type, which is accessible from QML by
importing the URL, "\c{io.qt.examples.backend 1.0}".
\li Replace the contents of \c main.qml with the following code:
-\quotefile code/backend/main.qml
+\snippet code/backend/main.qml main_qml
The \c BackEnd instance lets you access the \c userName property, which
is updated when the TextField's \c text property changes.