diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
commit | 6630937e63ae5797487b86743a7733c8ae5cc42c (patch) | |
tree | 3d53dacf6430f9099e1fb20835881205de674961 /examples/widgets/widgets/lineedits | |
parent | 37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff) | |
parent | c7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff) |
Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
Diffstat (limited to 'examples/widgets/widgets/lineedits')
-rw-r--r-- | examples/widgets/widgets/lineedits/window.cpp | 25 | ||||
-rw-r--r-- | examples/widgets/widgets/lineedits/window.h | 3 |
2 files changed, 14 insertions, 14 deletions
diff --git a/examples/widgets/widgets/lineedits/window.cpp b/examples/widgets/widgets/lineedits/window.cpp index ffb1edc5ce..33f09d544d 100644 --- a/examples/widgets/widgets/lineedits/window.cpp +++ b/examples/widgets/widgets/lineedits/window.cpp @@ -53,7 +53,8 @@ #include "window.h" //! [0] -Window::Window() +Window::Window(QWidget *parent) + : QWidget(parent) { QGroupBox *echoGroup = new QGroupBox(tr("Echo")); @@ -122,16 +123,16 @@ Window::Window() //! [4] //! [5] - connect(echoComboBox, SIGNAL(activated(int)), - this, SLOT(echoChanged(int))); - connect(validatorComboBox, SIGNAL(activated(int)), - this, SLOT(validatorChanged(int))); - connect(alignmentComboBox, SIGNAL(activated(int)), - this, SLOT(alignmentChanged(int))); - connect(inputMaskComboBox, SIGNAL(activated(int)), - this, SLOT(inputMaskChanged(int))); - connect(accessComboBox, SIGNAL(activated(int)), - this, SLOT(accessChanged(int))); + connect(echoComboBox, QOverload<int>::of(&QComboBox::activated), + this, &Window::echoChanged); + connect(validatorComboBox, QOverload<int>::of(&QComboBox::activated), + this, &Window::validatorChanged); + connect(alignmentComboBox, QOverload<int>::of(&QComboBox::activated), + this, &Window::alignmentChanged); + connect(inputMaskComboBox, QOverload<int>::of(&QComboBox::activated), + this, &Window::inputMaskChanged); + connect(accessComboBox, QOverload<int>::of(&QComboBox::activated), + this, &Window::accessChanged); //! [5] //! [6] @@ -205,7 +206,7 @@ void Window::validatorChanged(int index) { switch (index) { case 0: - validatorLineEdit->setValidator(0); + validatorLineEdit->setValidator(nullptr); break; case 1: validatorLineEdit->setValidator(new QIntValidator( diff --git a/examples/widgets/widgets/lineedits/window.h b/examples/widgets/widgets/lineedits/window.h index 2070b3b84c..a31634f3a3 100644 --- a/examples/widgets/widgets/lineedits/window.h +++ b/examples/widgets/widgets/lineedits/window.h @@ -54,7 +54,6 @@ #include <QWidget> QT_BEGIN_NAMESPACE -class QComboBox; class QLineEdit; QT_END_NAMESPACE @@ -64,7 +63,7 @@ class Window : public QWidget Q_OBJECT public: - Window(); + Window(QWidget *parent = nullptr); public slots: void echoChanged(int); |