diff options
author | Arno <arno@disconnect.de> | 2018-11-23 15:37:38 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-11-23 15:37:38 +0100 |
commit | dcd00ea7b241046780b4a14e8922b6fdf9a0a6a7 (patch) | |
tree | 35010968441561d2affe2bd0d7e21241c963e604 | |
parent | 2c542be7ddf0f8ef743ce3ccee8a71f4020776d1 (diff) | |
download | SheMov-dcd00ea7b241046780b4a14e8922b6fdf9a0a6a7.tar.gz SheMov-dcd00ea7b241046780b4a14e8922b6fdf9a0a6a7.tar.bz2 SheMov-dcd00ea7b241046780b4a14e8922b6fdf9a0a6a7.zip |
Bring mappingtablewidget.cpp into the 21st century
Use type-safe connects and weed out foreach.
-rw-r--r-- | mappingtablewidget.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mappingtablewidget.cpp b/mappingtablewidget.cpp index afc9c57..d42fcb9 100644 --- a/mappingtablewidget.cpp +++ b/mappingtablewidget.cpp @@ -5,12 +5,12 @@ 2 of the License, or (at your option) any later version. */ -#include <QtWidgets/QPushButton> -#include <QtWidgets/QLineEdit> -#include <QtWidgets/QVBoxLayout> -#include <QtWidgets/QLabel> -#include <QtWidgets/QCompleter> -#include <QtWidgets/QGroupBox> +#include <QPushButton> +#include <QLineEdit> +#include <QVBoxLayout> +#include <QLabel> +#include <QCompleter> +#include <QGroupBox> #include <QSettings> #include "mappingtablewidget.h" @@ -50,9 +50,9 @@ MappingTableWidget::MappingTableWidget(const QString &table, QWidget *parent) : mRemoveItem = new QPushButton(tr("Remove item")); buttonLayout->addWidget(mAddItem); buttonLayout->addWidget(mRemoveItem); - connect(mSearchItem, SIGNAL(clicked()), this, SLOT(searchItem())); - connect(mAddItem, SIGNAL(clicked()), this, SLOT(addItem())); - connect(mRemoveItem, SIGNAL(clicked()), this, SLOT(removeItem())); + connect(mSearchItem, &QPushButton::clicked, this, &MappingTableWidget::searchItem); + connect(mAddItem, &QPushButton::clicked, this, &MappingTableWidget::addItem); + connect(mRemoveItem, &QPushButton::clicked, this, &MappingTableWidget::removeItem); //layout QVBoxLayout *groupBoxLayout = new QVBoxLayout; @@ -115,7 +115,7 @@ void MappingTableWidget::removeItem(){ if(selected.isEmpty()){ return; } - foreach(QPersistentModelIndex i, selected){ + for(QPersistentModelIndex i : selected){ QString item = i.data().toString(); mModel->removeRows(i.row(), 1); QModelIndex itemIdx = mMappingModel->find(item); @@ -170,9 +170,9 @@ MappingTableResultDialog::MappingTableResultDialog(const QStringList &results, Q mView->setHeaderHidden(true); mView->setEditTriggers(QAbstractItemView::NoEditTriggers); mOk = new QPushButton(tr("Ok")); - connect(mOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(mOk, &QPushButton::clicked, this, &MappingTableResultDialog::accept); mCancel = new QPushButton(tr("Cancel")); - connect(mCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(mCancel, &QPushButton::clicked, this, &MappingTableResultDialog::reject); QLabel *caption = new QLabel(tr("Search results")); //layout |