aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/doc/images/cppintegration-ex.pngbin1777 -> 0 bytes
-rw-r--r--src/qml/doc/snippets/code/backend/backend.cpp71
-rw-r--r--src/qml/doc/snippets/code/backend/backend.h78
-rw-r--r--src/qml/doc/src/cppclasses/topic.qdoc2
-rw-r--r--src/qml/doc/src/cppintegration/extending-tutorial.qdoc10
-rw-r--r--src/qml/doc/src/cppintegration/topic.qdoc63
-rw-r--r--src/qml/doc/src/qtqml.qdoc1
7 files changed, 8 insertions, 217 deletions
diff --git a/src/qml/doc/images/cppintegration-ex.png b/src/qml/doc/images/cppintegration-ex.png
deleted file mode 100644
index 0b476ccb93..0000000000
--- a/src/qml/doc/images/cppintegration-ex.png
+++ /dev/null
Binary files differ
diff --git a/src/qml/doc/snippets/code/backend/backend.cpp b/src/qml/doc/snippets/code/backend/backend.cpp
deleted file mode 100644
index 58f5a15e2a..0000000000
--- a/src/qml/doc/snippets/code/backend/backend.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//! [backend_cpp]
-#include "backend.h"
-
-BackEnd::BackEnd(QObject *parent) :
- QObject(parent)
-{
-}
-
-QString BackEnd::userName()
-{
- return m_userName;
-}
-
-void BackEnd::setUserName(const QString &userName)
-{
- if (userName == m_userName)
- return;
-
- 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
deleted file mode 100644
index 6c64236bc7..0000000000
--- a/src/qml/doc/snippets/code/backend/backend.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//! [backend_header]
-#ifndef BACKEND_H
-#define BACKEND_H
-
-#include <QObject>
-#include <QString>
-#include <qqml.h>
-
-class BackEnd : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged)
- QML_ELEMENT
-
-public:
- explicit BackEnd(QObject *parent = nullptr);
-
- QString userName();
- void setUserName(const QString &userName);
-
-signals:
- void userNameChanged();
-
-private:
- QString m_userName;
-};
-
-#endif // BACKEND_H
-//! [backend_header]
diff --git a/src/qml/doc/src/cppclasses/topic.qdoc b/src/qml/doc/src/cppclasses/topic.qdoc
index 6b23dfd433..31f95d2f44 100644
--- a/src/qml/doc/src/cppclasses/topic.qdoc
+++ b/src/qml/doc/src/cppclasses/topic.qdoc
@@ -119,7 +119,7 @@ These pages describe how to create QML applications which interact with the
C++ classes:
\list
-\li \l{qtqml-cppintegration-topic.html}{Integrating QML and C++}
+\li \l{Overview - QML and C++ Integration}
\list
\li \l{qtqml-cppintegration-exposecppattributes.html}{Exposing Attributes of C++ Classes to QML}
\li \l{qtqml-cppintegration-definetypes.html}{Defining QML Types from C++}
diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
index a3e5ea3e3b..99bbbe39e4 100644
--- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
+++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
@@ -39,8 +39,8 @@ core QML features, including properties, signals and bindings. It also shows how
extensions can be deployed through plugins.
Many of the topics covered in this tutorial are documented in further detail in
-\l {qtqml-cppintegration-topic.html}{Integrating QML and C++} and its documentation
-sub-topics. In particular, you may be interested in the sub-topics
+\l{Overview - QML and C++ Integration} and its documentation sub-topics. In
+particular, you may be interested in the sub-topics
\l{qtqml-cppintegration-exposecppattributes.html}{Exposing Attributes of C++ Classes to QML}
and \l {qtqml-cppintegration-definetypes.html}{Defining QML Types from C++}.
@@ -52,6 +52,11 @@ the \uicontrol Welcome mode and select the tutorial from \uicontrol Examples. In
\uicontrol Edit mode, expand the \e extending-qml project, right-click on the
subproject (chapter) you want to run and select \uicontrol Run.
+\section1 Creating Tutorial Project
+
+We create a new project using the \e {Qt Quick Application} template in Qt Creator,
+as instructed in \l {Qt Creator: Creating Qt Quick Projects}.
+
\section1 Chapter 1: Creating a New Type
\c extending-qml/chapter1-basics
@@ -526,5 +531,4 @@ Or randomly add and remove slices from time to time using \l{Property Value Sour
}
\endcode
-\sa {Simple QML and C++ Integration Example}
*/
diff --git a/src/qml/doc/src/cppintegration/topic.qdoc b/src/qml/doc/src/cppintegration/topic.qdoc
index 8295533663..6c1eebbb12 100644
--- a/src/qml/doc/src/cppintegration/topic.qdoc
+++ b/src/qml/doc/src/cppintegration/topic.qdoc
@@ -24,69 +24,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/*!
-\page qtqml-cppintegration-topic.html
-\title Simple QML and C++ Integration Example
-\brief Provides instruction to integrate QML and C++
-
-QML applications often need to handle more advanced and performance-intensive
-tasks in C++. The most common and quickest way to do this is to expose the C++
-class to the QML runtime, provided the C++ implementation is derived from
-QObject. Assuming that you have Qt 5.7 or later installed, the following
-step-by-step instructions guide you through the process of using the C++ class,
-BackEnd, in a QML application:
-
-\list 1
-
-\li Create a new project using the "Qt Quick Application" template in Qt Creator
-
-\note Uncheck the \uicontrol {With ui.qml file} option in the
-\uicontrol {Define Project Details} section of \uicontrol {New Project Wizard}.
-
-\li Add a new C++ class called \c BackEnd to the project and replace its header
-file contents with:
-
-\snippet code/backend/backend.h backend_header
-
-The \c Q_PROPERTY macro declares a property that could be accessed from QML.
-The \c QML_ELEMENT macro makes the BackEnd class available in QML.
-
-\li Add the following lines to your project file:
-
-\badcode
-CONFIG += qmltypes
-QML_IMPORT_NAME = io.qt.examples.backend
-QML_IMPORT_MAJOR_VERSION = 1
-\endcode
-The BackEnd class is automatically 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{backend.cpp} with:
-
-\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
-\c onUserNameChanged handler.
-
-\li Replace the contents of \c main.qml with the following code:
-
-\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.
-
-\endlist
-
-Now the application can be run.
-
-\borderedimage cppintegration-ex.png
-\caption Application running on Ubuntu
-
-Qt offers several methods to integrate C++ with QML, and the method discussed
-in this tutorial is just one of them. For more details about these methods,
-refer to \l{Overview - QML and C++ Integration}.
-*/
/*!
\page qtqml-cppintegration-overview.html
diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc
index 1c2d611327..704142f516 100644
--- a/src/qml/doc/src/qtqml.qdoc
+++ b/src/qml/doc/src/qtqml.qdoc
@@ -143,7 +143,6 @@ the QML code to interact with C++ code.
\list
\li \l {Writing QML Extensions with C++}
- \li \l {Simple QML and C++ Integration Example}
\endlist
\omit