diff options
Diffstat (limited to 'examples/corelib/tools/customtypesending/window.cpp')
-rw-r--r-- | examples/corelib/tools/customtypesending/window.cpp | 9 |
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(); |