diff options
Diffstat (limited to 'examples/widgets/dialogs/findfiles')
-rw-r--r-- | examples/widgets/dialogs/findfiles/window.cpp | 19 | ||||
-rw-r--r-- | examples/widgets/dialogs/findfiles/window.h | 1 |
2 files changed, 6 insertions, 14 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] diff --git a/examples/widgets/dialogs/findfiles/window.h b/examples/widgets/dialogs/findfiles/window.h index 281c932e2f..89dd87b83b 100644 --- a/examples/widgets/dialogs/findfiles/window.h +++ b/examples/widgets/dialogs/findfiles/window.h @@ -68,7 +68,6 @@ private slots: private: QStringList findFiles(const QStringList &files, const QString &text); void showFiles(const QStringList &files); - QPushButton *createButton(const QString &text, const char *member); QComboBox *createComboBox(const QString &text = QString()); void createFilesTable(); |