diff options
-rw-r--r-- | src/qml/doc/snippets/code/backend/backend.cpp | 3 | ||||
-rw-r--r-- | src/qml/doc/snippets/code/backend/backend.h | 3 | ||||
-rw-r--r-- | src/qml/doc/snippets/code/backend/main.cpp | 3 | ||||
-rw-r--r-- | src/qml/doc/snippets/code/backend/main.qml | 4 | ||||
-rw-r--r-- | src/qml/doc/src/cppintegration/topic.qdoc | 8 |
5 files changed, 12 insertions, 9 deletions
diff --git a/src/qml/doc/snippets/code/backend/backend.cpp b/src/qml/doc/snippets/code/backend/backend.cpp index 4a7ee89cec..58f5a15e2a 100644 --- a/src/qml/doc/snippets/code/backend/backend.cpp +++ b/src/qml/doc/snippets/code/backend/backend.cpp @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [backend_cpp] #include "backend.h" BackEnd::BackEnd(QObject *parent) : @@ -68,3 +68,4 @@ void BackEnd::setUserName(const QString &userName) m_userName = userName; emit userNameChanged(); } +//! [backend_cpp] diff --git a/src/qml/doc/snippets/code/backend/backend.h b/src/qml/doc/snippets/code/backend/backend.h index 91bb766e1f..fa7ce9eb86 100644 --- a/src/qml/doc/snippets/code/backend/backend.h +++ b/src/qml/doc/snippets/code/backend/backend.h @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [backend_header] #ifndef BACKEND_H #define BACKEND_H @@ -73,3 +73,4 @@ private: }; #endif // BACKEND_H +//! [backend_header] diff --git a/src/qml/doc/snippets/code/backend/main.cpp b/src/qml/doc/snippets/code/backend/main.cpp index d7a1bcbd4f..91a012dfda 100644 --- a/src/qml/doc/snippets/code/backend/main.cpp +++ b/src/qml/doc/snippets/code/backend/main.cpp @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [main_cpp] #include <QGuiApplication> #include <QQmlApplicationEngine> @@ -64,3 +64,4 @@ int main(int argc, char *argv[]) return app.exec(); } +//! [main_cpp] diff --git a/src/qml/doc/snippets/code/backend/main.qml b/src/qml/doc/snippets/code/backend/main.qml index 3720da8412..fadc9cd768 100644 --- a/src/qml/doc/snippets/code/backend/main.qml +++ b/src/qml/doc/snippets/code/backend/main.qml @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [main_qml] import QtQuick 2.6 import QtQuick.Controls 2.0 //![import] @@ -76,4 +76,4 @@ ApplicationWindow { } //![username_input] } - +//! [main_qml] 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. |