summaryrefslogtreecommitdiffstats
path: root/examples/corelib/tools/customtypesending
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib/tools/customtypesending')
-rw-r--r--examples/corelib/tools/customtypesending/CMakeLists.txt38
-rw-r--r--examples/corelib/tools/customtypesending/customtypesending.pro10
-rw-r--r--examples/corelib/tools/customtypesending/main.cpp31
-rw-r--r--examples/corelib/tools/customtypesending/message.cpp19
-rw-r--r--examples/corelib/tools/customtypesending/message.h34
-rw-r--r--examples/corelib/tools/customtypesending/window.cpp43
-rw-r--r--examples/corelib/tools/customtypesending/window.h35
7 files changed, 0 insertions, 210 deletions
diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt
deleted file mode 100644
index 83c2ebfd4f..0000000000
--- a/examples/corelib/tools/customtypesending/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-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 94f41d73a8..0000000000
--- a/examples/corelib/tools/customtypesending/main.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#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 dfb5c5359a..0000000000
--- a/examples/corelib/tools/customtypesending/message.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#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 2df50115c4..0000000000
--- a/examples/corelib/tools/customtypesending/message.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#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 f294af3ec2..0000000000
--- a/examples/corelib/tools/customtypesending/window.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#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 a3a318e382..0000000000
--- a/examples/corelib/tools/customtypesending/window.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#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