summaryrefslogtreecommitdiffstats
path: root/examples/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib/tools')
-rw-r--r--examples/corelib/tools/CMakeLists.txt7
-rw-r--r--examples/corelib/tools/contiguouscache/CMakeLists.txt34
-rw-r--r--examples/corelib/tools/contiguouscache/main.cpp51
-rw-r--r--examples/corelib/tools/contiguouscache/randomlistmodel.cpp71
-rw-r--r--examples/corelib/tools/contiguouscache/randomlistmodel.h52
-rw-r--r--examples/corelib/tools/customtype/CMakeLists.txt34
-rw-r--r--examples/corelib/tools/customtype/customtype.pro8
-rw-r--r--examples/corelib/tools/customtype/main.cpp84
-rw-r--r--examples/corelib/tools/customtype/message.cpp84
-rw-r--r--examples/corelib/tools/customtype/message.h85
-rw-r--r--examples/corelib/tools/customtypesending/CMakeLists.txt35
-rw-r--r--examples/corelib/tools/customtypesending/customtypesending.pro10
-rw-r--r--examples/corelib/tools/customtypesending/main.cpp78
-rw-r--r--examples/corelib/tools/customtypesending/message.cpp66
-rw-r--r--examples/corelib/tools/customtypesending/message.h81
-rw-r--r--examples/corelib/tools/customtypesending/window.cpp90
-rw-r--r--examples/corelib/tools/customtypesending/window.h82
-rw-r--r--examples/corelib/tools/doc/src/contiguouscache.qdoc31
-rw-r--r--examples/corelib/tools/doc/src/customtype.qdoc135
-rw-r--r--examples/corelib/tools/tools.pro4
20 files changed, 42 insertions, 1080 deletions
diff --git a/examples/corelib/tools/CMakeLists.txt b/examples/corelib/tools/CMakeLists.txt
index a8db41edee..15188b0219 100644
--- a/examples/corelib/tools/CMakeLists.txt
+++ b/examples/corelib/tools/CMakeLists.txt
@@ -1,6 +1,7 @@
-if(NOT TARGET Qt::Widgets)
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+if(NOT TARGET Qt6::Widgets)
return()
endif()
qt_internal_add_example(contiguouscache)
-qt_internal_add_example(customtype)
-qt_internal_add_example(customtypesending)
diff --git a/examples/corelib/tools/contiguouscache/CMakeLists.txt b/examples/corelib/tools/contiguouscache/CMakeLists.txt
index 5c5f8a0b89..2fab4803c1 100644
--- a/examples/corelib/tools/contiguouscache/CMakeLists.txt
+++ b/examples/corelib/tools/contiguouscache/CMakeLists.txt
@@ -1,16 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(contiguouscache LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/corelib/tools/contiguouscache")
-
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(contiguouscache
main.cpp
randomlistmodel.cpp randomlistmodel.h
@@ -21,14 +18,21 @@ set_target_properties(contiguouscache PROPERTIES
MACOSX_BUNDLE TRUE
)
-target_link_libraries(contiguouscache PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+target_link_libraries(contiguouscache PRIVATE
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS contiguouscache
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION .
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+qt_generate_deploy_app_script(
+ TARGET contiguouscache
+ OUTPUT_SCRIPT deploy_script
+ NO_UNSUPPORTED_PLATFORM_ERROR
)
+install(SCRIPT ${deploy_script})
diff --git a/examples/corelib/tools/contiguouscache/main.cpp b/examples/corelib/tools/contiguouscache/main.cpp
index 4f31e21147..29e77aff2c 100644
--- a/examples/corelib/tools/contiguouscache/main.cpp
+++ b/examples/corelib/tools/contiguouscache/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "randomlistmodel.h"
#include <QListView>
diff --git a/examples/corelib/tools/contiguouscache/randomlistmodel.cpp b/examples/corelib/tools/contiguouscache/randomlistmodel.cpp
index d028b896f2..4832f0ae24 100644
--- a/examples/corelib/tools/contiguouscache/randomlistmodel.cpp
+++ b/examples/corelib/tools/contiguouscache/randomlistmodel.cpp
@@ -1,65 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "randomlistmodel.h"
#include <QRandomGenerator>
-static const int bufferSize(500);
-static const int lookAhead(100);
-static const int halfLookAhead(lookAhead/2);
+static constexpr int bufferSize(500);
+static constexpr int lookAhead(100);
+static constexpr int halfLookAhead(lookAhead / 2);
RandomListModel::RandomListModel(QObject *parent)
-: QAbstractListModel(parent), m_rows(bufferSize), m_count(10000)
-{
-}
-
-RandomListModel::~RandomListModel()
+ : QAbstractListModel(parent), m_rows(bufferSize), m_count(10000)
{
}
@@ -78,14 +27,14 @@ QVariant RandomListModel::data(const QModelIndex &index, int role) const
if (row > m_rows.lastIndex()) {
if (row - m_rows.lastIndex() > lookAhead)
- cacheRows(row-halfLookAhead, qMin(m_count, row+halfLookAhead));
+ cacheRows(row - halfLookAhead, qMin(m_count, row + halfLookAhead));
else while (row > m_rows.lastIndex())
- m_rows.append(fetchRow(m_rows.lastIndex()+1));
+ m_rows.append(fetchRow(m_rows.lastIndex() + 1));
} else if (row < m_rows.firstIndex()) {
if (m_rows.firstIndex() - row > lookAhead)
- cacheRows(qMax(0, row-halfLookAhead), row+halfLookAhead);
+ cacheRows(qMax(0, row - halfLookAhead), row + halfLookAhead);
else while (row < m_rows.firstIndex())
- m_rows.prepend(fetchRow(m_rows.firstIndex()-1));
+ m_rows.prepend(fetchRow(m_rows.firstIndex() - 1));
}
return m_rows.at(row);
diff --git a/examples/corelib/tools/contiguouscache/randomlistmodel.h b/examples/corelib/tools/contiguouscache/randomlistmodel.h
index 1fabb0d9f5..b95acdf3f9 100644
--- a/examples/corelib/tools/contiguouscache/randomlistmodel.h
+++ b/examples/corelib/tools/contiguouscache/randomlistmodel.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef RANDOMLISTMODEL_H
#define RANDOMLISTMODEL_H
@@ -60,7 +13,6 @@ class RandomListModel : public QAbstractListModel
Q_OBJECT
public:
RandomListModel(QObject *parent = nullptr);
- ~RandomListModel();
int rowCount(const QModelIndex & = QModelIndex()) const override;
QVariant data(const QModelIndex &, int) const override;
diff --git a/examples/corelib/tools/customtype/CMakeLists.txt b/examples/corelib/tools/customtype/CMakeLists.txt
deleted file mode 100644
index 2d8a0c0f4c..0000000000
--- a/examples/corelib/tools/customtype/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-cmake_minimum_required(VERSION 3.16)
-project(customtype LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/corelib/tools/customtype")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
-
-qt_add_executable(customtype
- main.cpp
- message.cpp message.h
-)
-
-set_target_properties(customtype PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(customtype PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS customtype
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/corelib/tools/customtype/customtype.pro b/examples/corelib/tools/customtype/customtype.pro
deleted file mode 100644
index 0e0fe9b1a5..0000000000
--- a/examples/corelib/tools/customtype/customtype.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-HEADERS = message.h
-SOURCES = main.cpp \
- message.cpp
-QT += widgets
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/corelib/tools/customtype
-INSTALLS += target
diff --git a/examples/corelib/tools/customtype/main.cpp b/examples/corelib/tools/customtype/main.cpp
deleted file mode 100644
index af8e233a19..0000000000
--- a/examples/corelib/tools/customtype/main.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#include <QCoreApplication>
-#include <QDebug>
-#include <QVariant>
-#include "message.h"
-
-int main(int argc, char *argv[])
-{
- QCoreApplication app(argc, argv);
- QStringList headers;
- headers << "Subject: Hello World"
- << "From: address@example.com";
- QString body = "This is a test.\r\n";
-
-//! [printing a custom type]
- Message message(body, headers);
- qDebug() << "Original:" << message;
-//! [printing a custom type]
-
-//! [storing a custom value]
- QVariant stored;
- stored.setValue(message);
-//! [storing a custom value]
-
- qDebug() << "Stored:" << stored;
-
-//! [retrieving a custom value]
- Message retrieved = qvariant_cast<Message>(stored);
- qDebug() << "Retrieved:" << retrieved;
- retrieved = qvariant_cast<Message>(stored);
- qDebug() << "Retrieved:" << retrieved;
-//! [retrieving a custom value]
-
- return 0;
-}
diff --git a/examples/corelib/tools/customtype/message.cpp b/examples/corelib/tools/customtype/message.cpp
deleted file mode 100644
index 948e323dbf..0000000000
--- a/examples/corelib/tools/customtype/message.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#include "message.h"
-
-#include <QDebug>
-
-Message::Message(const QString &body, const QStringList &headers)
- : m_body(body), m_headers(headers)
-{
-}
-
-//! [custom type streaming operator]
-QDebug operator<<(QDebug dbg, const Message &message)
-{
- QList<QStringView> pieces = message.body().split(u"\r\n", Qt::SkipEmptyParts);
- if (pieces.isEmpty())
- dbg.nospace() << "Message()";
- else if (pieces.size() == 1)
- dbg.nospace() << "Message(" << pieces.first() << ")";
- else
- dbg.nospace() << "Message(" << pieces.first() << " ...)";
- return dbg.maybeSpace();
-}
-//! [custom type streaming operator]
-
-//! [getter functions]
-QStringView Message::body() const
-{
- return m_body;
-}
-
-QStringList Message::headers() const
-{
- return m_headers;
-}
-//! [getter functions]
diff --git a/examples/corelib/tools/customtype/message.h b/examples/corelib/tools/customtype/message.h
deleted file mode 100644
index acc439b0f6..0000000000
--- a/examples/corelib/tools/customtype/message.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#ifndef MESSAGE_H
-#define MESSAGE_H
-
-#include <QMetaType>
-#include <QStringList>
-
-//! [custom type definition]
-class Message
-{
-public:
- Message() = default;
- ~Message() = default;
- Message(const Message &) = default;
- Message &operator=(const Message &) = default;
-
- Message(const QString &body, const QStringList &headers);
-
- QStringView body() const;
- QStringList headers() const;
-
-private:
- QString m_body;
- QStringList m_headers;
-};
-//! [custom type definition]
-
-//! [custom type meta-type declaration]
-Q_DECLARE_METATYPE(Message);
-//! [custom type meta-type declaration]
-
-//! [custom type streaming operator]
-QDebug operator<<(QDebug dbg, const Message &message);
-//! [custom type streaming operator]
-
-#endif
diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt
deleted file mode 100644
index 22e4dd0518..0000000000
--- a/examples/corelib/tools/customtypesending/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-cmake_minimum_required(VERSION 3.16)
-project(customtypesending LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/corelib/tools/customtypesending")
-
-find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
-
-qt_add_executable(customtypesending
- main.cpp
- message.cpp message.h
- window.cpp window.h
-)
-
-set_target_properties(customtypesending PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-
-target_link_libraries(customtypesending PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS customtypesending
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/corelib/tools/customtypesending/customtypesending.pro b/examples/corelib/tools/customtypesending/customtypesending.pro
deleted file mode 100644
index da351ce828..0000000000
--- a/examples/corelib/tools/customtypesending/customtypesending.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-HEADERS = message.h \
- window.h
-SOURCES = main.cpp \
- message.cpp \
- window.cpp
-QT += widgets
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/corelib/tools/customtypesending
-INSTALLS += target
diff --git a/examples/corelib/tools/customtypesending/main.cpp b/examples/corelib/tools/customtypesending/main.cpp
deleted file mode 100644
index c5d643b9d1..0000000000
--- a/examples/corelib/tools/customtypesending/main.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "message.h"
-#include "window.h"
-
-//! [main function]
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QStringList headers;
- headers << "Subject: Hello World"
- << "From: address@example.com";
- QString body = "This is a test.\r\n";
- Message message(body, headers);
-
- Window window1;
- window1.setMessage(message);
-
- Window window2;
- QObject::connect(&window1, &Window::messageSent,
- &window2, &Window::setMessage);
- QObject::connect(&window2, &Window::messageSent,
- &window1, &Window::setMessage);
- window1.show();
- window2.show();
- return app.exec();
-}
-//! [main function]
diff --git a/examples/corelib/tools/customtypesending/message.cpp b/examples/corelib/tools/customtypesending/message.cpp
deleted file mode 100644
index 76f90e5144..0000000000
--- a/examples/corelib/tools/customtypesending/message.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#include "message.h"
-
-Message::Message(const QString &body, const QStringList &headers)
- : m_body(body), m_headers(headers)
-{
-}
-
-QString Message::body() const
-{
- return m_body;
-}
-
-QStringList Message::headers() const
-{
- return m_headers;
-}
diff --git a/examples/corelib/tools/customtypesending/message.h b/examples/corelib/tools/customtypesending/message.h
deleted file mode 100644
index 38b5c8205f..0000000000
--- a/examples/corelib/tools/customtypesending/message.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#ifndef MESSAGE_H
-#define MESSAGE_H
-
-#include <QMetaType>
-#include <QStringList>
-
-//! [custom type definition]
-class Message
-{
-public:
- Message() = default;
- ~Message() = default;
- Message(const Message &) = default;
- Message &operator=(const Message &) = default;
-
- Message(const QString &body, const QStringList &headers);
-
- QString body() const;
- QStringList headers() const;
-
-private:
- QString m_body;
- QStringList m_headers;
-};
-//! [custom type definition]
-
-//! [custom type meta-type declaration]
-Q_DECLARE_METATYPE(Message);
-//! [custom type meta-type declaration]
-
-#endif
diff --git a/examples/corelib/tools/customtypesending/window.cpp b/examples/corelib/tools/customtypesending/window.cpp
deleted file mode 100644
index db4b52a985..0000000000
--- a/examples/corelib/tools/customtypesending/window.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#include <QtWidgets>
-#include "window.h"
-
-//! [Window constructor]
-Window::Window(QWidget *parent)
- : QWidget(parent), editor(new QTextEdit(this))
-{
- QPushButton *sendButton = new QPushButton(tr("&Send message"));
-
- connect(sendButton, &QPushButton::clicked,
- this, &Window::sendMessage);
-
- QHBoxLayout *buttonLayout = new QHBoxLayout;
- buttonLayout->addStretch();
- buttonLayout->addWidget(sendButton);
- buttonLayout->addStretch();
-
- QVBoxLayout *layout = new QVBoxLayout(this);
- layout->addWidget(editor);
- layout->addLayout(buttonLayout);
-
- setWindowTitle(tr("Custom Type Sending"));
-}
-//! [Window constructor]
-
-//! [sending a message]
-void Window::sendMessage()
-{
- thisMessage = Message(editor->toPlainText(), thisMessage.headers());
- emit messageSent(thisMessage);
-}
-//! [sending a message]
-
-//! [receiving a message]
-void Window::setMessage(const Message &message)
-{
- thisMessage = message;
- editor->setPlainText(thisMessage.body());
-}
-//! [receiving a message]
diff --git a/examples/corelib/tools/customtypesending/window.h b/examples/corelib/tools/customtypesending/window.h
deleted file mode 100644
index 048fecef67..0000000000
--- a/examples/corelib/tools/customtypesending/window.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples 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$
-**
-****************************************************************************/
-
-#ifndef WINDOW_H
-#define WINDOW_H
-
-#include <QWidget>
-#include "message.h"
-
-QT_FORWARD_DECLARE_CLASS(QTextEdit)
-
-//! [Window class definition]
-class Window : public QWidget
-{
- Q_OBJECT
-
-public:
- Window(QWidget *parent = nullptr);
-
-signals:
- void messageSent(const Message &message);
-
-public slots:
- void setMessage(const Message &message);
-
-private slots:
- void sendMessage();
-
-private:
- Message thisMessage;
- QTextEdit *editor;
-};
-//! [Window class definition]
-
-#endif
diff --git a/examples/corelib/tools/doc/src/contiguouscache.qdoc b/examples/corelib/tools/doc/src/contiguouscache.qdoc
index 0d06036cd1..9fc572927b 100644
--- a/examples/corelib/tools/doc/src/contiguouscache.qdoc
+++ b/examples/corelib/tools/doc/src/contiguouscache.qdoc
@@ -1,33 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example tools/contiguouscache
\title Contiguous Cache Example
+ \examplecategory {Data Processing & I/O}
\brief The Contiguous Cache example shows how to use QContiguousCache to manage memory usage for
very large models. In some environments memory is limited and, even when it
@@ -68,7 +45,7 @@
allow for gaps. If your cache needs to quickly jump back and forth between
rows with significant gaps between them consider using QCache instead.
- And thats it. A perfectly reasonable cache, using minimal memory for a very large
+ And that's it. A perfectly reasonable cache, using minimal memory for a very large
list. In this case the accessor for getting the words into the cache
generates random information rather than fixed information. This allows you
to see how the cache range is kept for a local number of rows when running the
diff --git a/examples/corelib/tools/doc/src/customtype.qdoc b/examples/corelib/tools/doc/src/customtype.qdoc
deleted file mode 100644
index fb63bc539c..0000000000
--- a/examples/corelib/tools/doc/src/customtype.qdoc
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** 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.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example tools/customtype
- \title Custom Type Example
-
- \brief The Custom Type example shows how to integrate a custom type into Qt's
- meta-object system.
-
- Contents:
-
- \tableofcontents
-
- \section1 Overview
-
- Qt provides a range of standard value types that are used to provide
- rich and meaningful APIs. These types are integrated with the meta-object
- system, enabling them to be stored in QVariant objects, written out in
- debugging information and sent between components in signal-slot
- communication.
-
- Custom types can also be integrated with the meta-object system as long as
- they are written to conform to some simple guidelines. In this example, we
- introduce a simple \c Message class, we describe how we make it work with
- QVariant, and we show how it can be extended to generate a printable
- representation of itself for use in debugging output.
-
- \section1 The Message Class Definition
-
- The \c Message class is a simple value class that contains two pieces
- of information (a QString and a QStringList), each of which can be read
- using trivial getter functions:
-
- \snippet tools/customtype/message.h custom type definition
-
- The default constructor, copy constructor and destructor are
- all required, and must be public, if the type is to be integrated into the
- meta-object system. Other than this, we are free to implement whatever we
- need to make the type do what we want, so we also include a constructor
- that lets us set the type's data members.
-
- To enable the type to be used with QVariant, we declare it using the
- Q_DECLARE_METATYPE() macro:
-
- \snippet tools/customtype/message.h custom type meta-type declaration
-
- We do not need to write any additional code to accompany this macro.
-
- To allow us to see a readable description of each \c Message object when it
- is sent to the debug output stream, we define a streaming operator:
-
- \snippet tools/customtype/message.h custom type streaming operator
-
- This facility is useful if you need to insert tracing statements in your
- code for debugging purposes.
-
- \section1 The Message Class Implementation
-
- The streaming operator is implemented in the following way:
-
- \snippet tools/customtype/message.cpp custom type streaming operator
-
- Here, we want to represent each value depending on how many lines are stored
- in the message body. We stream text to the QDebug object passed to the
- operator and return the QDebug object obtained from its maybeSpace() member
- function; this is described in more detail in the
- \l{Creating Custom Qt Types#Making the Type Printable}{Creating Custom Qt Types}
- document.
-
- We include the code for the getter functions for completeness:
-
- \snippet tools/customtype/message.cpp getter functions
-
- With the type fully defined, implemented, and integrated with the
- meta-object system, we can now use it.
-
- \section1 Using the Message
-
- In the example's \c{main()} function, we show how a \c Message object can
- be printed to the console by sending it to the debug stream:
-
- \snippet tools/customtype/main.cpp printing a custom type
-
- You can use the type with QVariant in exactly the same way as you would
- use standard Qt value types. Here's how to store a value using the
- QVariant::setValue() function:
-
- \snippet tools/customtype/main.cpp storing a custom value
-
- Alternatively, the QVariant::fromValue() function can be used if
- you are using a compiler without support for member template
- functions.
-
- The value can be retrieved using the QVariant::value() member template
- function:
-
- \snippet tools/customtype/main.cpp retrieving a custom value
-
- \section1 Further Reading
-
- The custom \c Message type can also be used with direct signal-slot
- connections.
-
- To register a custom type for use with queued signals and slots, such as
- those used in cross-thread communication, see the
- \l{Queued Custom Type Example}.
-
- More information on using custom types with Qt can be found in the
- \l{Creating Custom Qt Types} document.
-*/
diff --git a/examples/corelib/tools/tools.pro b/examples/corelib/tools/tools.pro
index 6fb4a1214f..618628d274 100644
--- a/examples/corelib/tools/tools.pro
+++ b/examples/corelib/tools/tools.pro
@@ -1,6 +1,4 @@
requires(qtHaveModule(widgets))
TEMPLATE = subdirs
-SUBDIRS = contiguouscache \
- customtype \
- customtypesending
+SUBDIRS = contiguouscache