diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-21 14:41:36 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-22 04:12:45 +0000 |
commit | 0e727823638eac011bbbf2c11bcf408b0badd2d1 (patch) | |
tree | 7d86deefcaa545f4039acd3a4bcc7ebc2fa68df4 /examples/widgets/dialogs/findfiles/window.cpp | |
parent | 852b1d7b9bcacdb5ce28fab6fba94ec119adda5d (diff) |
Port examples/widgets/dialogs to new connection syntax.
Change-Id: Ife8a24b43db400909099765b43f016b4be4bd6ef
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'examples/widgets/dialogs/findfiles/window.cpp')
-rw-r--r-- | examples/widgets/dialogs/findfiles/window.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/examples/widgets/dialogs/findfiles/window.cpp b/examples/widgets/dialogs/findfiles/window.cpp index 86c34a6352..780c398ad5 100644 --- a/examples/widgets/dialogs/findfiles/window.cpp +++ b/examples/widgets/dialogs/findfiles/window.cpp @@ -46,8 +46,10 @@ Window::Window(QWidget *parent) : QWidget(parent) { - browseButton = createButton(tr("&Browse..."), SLOT(browse())); - findButton = createButton(tr("&Find"), SLOT(find())); + browseButton = new QPushButton(tr("&Browse..."), this); + connect(browseButton, &QAbstractButton::clicked, this, &Window::browse); + findButton = new QPushButton(tr("&Find"), this); + connect(findButton, &QAbstractButton::clicked, this, &Window::find); fileComboBox = createComboBox(tr("*")); textComboBox = createComboBox(); @@ -195,15 +197,6 @@ void Window::showFiles(const QStringList &files) } //! [8] -//! [9] -QPushButton *Window::createButton(const QString &text, const char *member) -{ - QPushButton *button = new QPushButton(text); - connect(button, SIGNAL(clicked()), this, member); - return button; -} -//! [9] - //! [10] QComboBox *Window::createComboBox(const QString &text) { @@ -228,8 +221,8 @@ void Window::createFilesTable() filesTable->verticalHeader()->hide(); filesTable->setShowGrid(false); - connect(filesTable, SIGNAL(cellActivated(int,int)), - this, SLOT(openFileOfItem(int,int))); + connect(filesTable, &QTableWidget::cellActivated, + this, &Window::openFileOfItem); } //! [11] |