diff options
author | Arno <arno@disconnect.de> | 2018-02-01 01:33:50 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-02-01 01:33:50 +0100 |
commit | d6a44b289027db999e50a2b346327e6650a4f43c (patch) | |
tree | 9524ab4c154990fa5227fcb34103bc9331163b88 | |
parent | bf1366e4b8ecc3edc42d0d6511b3b91d6a1c805f (diff) | |
download | ShemovCleaner-d6a44b289027db999e50a2b346327e6650a4f43c.tar.gz ShemovCleaner-d6a44b289027db999e50a2b346327e6650a4f43c.tar.bz2 ShemovCleaner-d6a44b289027db999e50a2b346327e6650a4f43c.zip |
Modernize OriginDialog
Use type safe connect syntax and remove one Q_FOREACH makro.
Make the reject button a non-member, but keep the OK button. I thought
about gettring rid of the latter, too, but deactivating OK when no match
is the most sensible way to go...
-rw-r--r-- | origindialog.cpp | 10 | ||||
-rw-r--r-- | origindialog.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/origindialog.cpp b/origindialog.cpp index f885132..c2f5835 100644 --- a/origindialog.cpp +++ b/origindialog.cpp @@ -64,13 +64,13 @@ void OriginDialog::setupGui(){ dstLayout->addWidget(mDstMd5, 3, 1); destGB->setLayout(dstLayout); mOk = new QPushButton(tr("Add")); - connect(mOk, SIGNAL(clicked()), this, SLOT(accept())); - mCancel = new QPushButton(tr("Cancel")); - connect(mCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(mOk, &QPushButton::clicked, this, &OriginDialog::accept); + QPushButton *cancelB = new QPushButton(tr("Cancel")); + connect(cancelB, &QPushButton::clicked, this, &OriginDialog::reject); QHBoxLayout *btnLayout = new QHBoxLayout; btnLayout->addStretch(); btnLayout->addWidget(mOk); - btnLayout->addWidget(mCancel); + btnLayout->addWidget(cancelB); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(origGB); mainLayout->addWidget(destGB); @@ -142,7 +142,7 @@ void OriginDialog::setDstData(const QString &absolutefn){ } void OriginDialog::clear(){ - foreach(QLineEdit *le, mLineEdits){ + for(QLineEdit *le : mLineEdits){ le->clear(); } } diff --git a/origindialog.h b/origindialog.h index dd9cb3f..2380af6 100644 --- a/origindialog.h +++ b/origindialog.h @@ -35,7 +35,6 @@ class OriginDialog : public QDialog { QLineEdit *mDstMd5; QVector<QLineEdit*> mLineEdits; QPushButton *mOk; - QPushButton *mCancel; qint64 mSeconds; qint64 mSize; qint64 mBitrate; |