diff options
Diffstat (limited to 'examples/corelib/tools/customtypesending/window.cpp')
-rw-r--r-- | examples/corelib/tools/customtypesending/window.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
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] |