summaryrefslogtreecommitdiffstats
path: root/examples/corelib/tools/customtypesending/window.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
commit6630937e63ae5797487b86743a7733c8ae5cc42c (patch)
tree3d53dacf6430f9099e1fb20835881205de674961 /examples/corelib/tools/customtypesending/window.cpp
parent37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff)
parentc7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff)
Merge commit 'dev' into 'wip/cmake-merge'
Diffstat (limited to 'examples/corelib/tools/customtypesending/window.cpp')
-rw-r--r--examples/corelib/tools/customtypesending/window.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/corelib/tools/customtypesending/window.cpp b/examples/corelib/tools/customtypesending/window.cpp
index 224656f94c..db4b52a985 100644
--- a/examples/corelib/tools/customtypesending/window.cpp
+++ b/examples/corelib/tools/customtypesending/window.cpp
@@ -52,14 +52,15 @@
#include "window.h"
//! [Window constructor]
-Window::Window()
+Window::Window(QWidget *parent)
+ : QWidget(parent), editor(new QTextEdit(this))
{
- editor = new QTextEdit();
QPushButton *sendButton = new QPushButton(tr("&Send message"));
- connect(sendButton, SIGNAL(clicked()), this, SLOT(sendMessage()));
+ connect(sendButton, &QPushButton::clicked,
+ this, &Window::sendMessage);
- QHBoxLayout *buttonLayout = new QHBoxLayout();
+ QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addStretch();
buttonLayout->addWidget(sendButton);
buttonLayout->addStretch();