diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-06-19 08:20:16 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-06-19 08:20:16 +0200 |
commit | 7d28940a316128c8ee43def83a71843711d702c9 (patch) | |
tree | 613537bedaeccae8711cb2009614c8f617374adf /src/qml/doc/src/cppintegration/topic.qdoc | |
parent | 4199572d64d46bfa2efdcf7c910e81e5b8fb5547 (diff) | |
parent | 1e0685136d0debb2a3b62d9f4650c95afe41913b (diff) |
Merge 5.9 into 5.9.1
Change-Id: I4154bf5f6f0b74176e333541372511d47d408546
Diffstat (limited to 'src/qml/doc/src/cppintegration/topic.qdoc')
-rw-r--r-- | src/qml/doc/src/cppintegration/topic.qdoc | 8 |
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. |