summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-09-29 17:12:08 +0200
committerArno <arno@disconnect.de>2018-09-29 17:12:08 +0200
commit370c1073155d81cfbcea146209876662a72f2f20 (patch)
treef155b8d7a3b310e5386ec54c16bbfbf258e39344
parentc0d4cdd495571397f733525e88b8d268a360f522 (diff)
downloadSheMov-370c1073155d81cfbcea146209876662a72f2f20.tar.gz
SheMov-370c1073155d81cfbcea146209876662a72f2f20.tar.bz2
SheMov-370c1073155d81cfbcea146209876662a72f2f20.zip
Make QPushButtons in RandomTab local
While at it, convert to type-safe connect syntax.
-rw-r--r--randomtab.cpp32
-rw-r--r--randomtab.h5
2 files changed, 16 insertions, 21 deletions
diff --git a/randomtab.cpp b/randomtab.cpp
index 291dcd7..bb6b7c6 100644
--- a/randomtab.cpp
+++ b/randomtab.cpp
@@ -95,26 +95,26 @@ void RandomTab::setupGui(){
actorBox->setLayout(actorL);
QGroupBox *actionBox = new QGroupBox(tr("Energize!"));
- mRefresh = new QPushButton(QIcon(":/refresh.png"), tr("Refresh"));
- connect(mRefresh, SIGNAL(clicked()), this, SLOT(refreshComboboxes()));
- mClear = new QPushButton(QIcon(":/delete.png"), tr("Clear"));
- connect(mClear, SIGNAL(clicked()), this, SLOT(clearAll()));
- mSelect = new QPushButton(QIcon(":/huge_bra.png"), tr("Go!"));
- connect(mSelect, SIGNAL(clicked()), this, SLOT(select()));
+ QPushButton *refreshB = new QPushButton(QIcon(":/refresh.png"), tr("Refresh"));
+ connect(refreshB, &QPushButton::clicked, this, &RandomTab::refreshComboboxes);
+ QPushButton *clearB = new QPushButton(QIcon(":/delete.png"), tr("Clear"));
+ connect(clearB, &QPushButton::clicked, this, &RandomTab::clearAll);
+ QPushButton *goB = new QPushButton(QIcon(":/huge_bra.png"), tr("Go!"));
+ connect(goB, &QPushButton::clicked, this, &RandomTab::select);
QGridLayout *actionL = new QGridLayout;
- actionL->addWidget(mClear, 0, 0);
- actionL->addWidget(mRefresh, 0, 1);
- actionL->addWidget(mSelect, 1, 0, 2, 0);
+ actionL->addWidget(clearB, 0, 0);
+ actionL->addWidget(refreshB, 0, 1);
+ actionL->addWidget(goB, 1, 0, 2, 0);
actionBox->setLayout(actionL);
QGroupBox *playBox = new QGroupBox(tr("Play"));
- mPlayAll = new QPushButton(QIcon(":/gaping_ass.png"), tr("Play All"));
- connect(mPlayAll, SIGNAL(clicked()), this, SLOT(playAll()));
- mPlaySelected = new QPushButton(QIcon(":/big_ass.png"), tr("Play Selected"));
- connect(mPlaySelected, SIGNAL(clicked()), this, SLOT(playSelected()));
+ QPushButton *playAllB = new QPushButton(QIcon(":/gaping_ass.png"), tr("Play All"));
+ connect(playAllB, &QPushButton::clicked, this, &RandomTab::playAll);
+ QPushButton *playSelectedB = new QPushButton(QIcon(":/big_ass.png"), tr("Play Selected"));
+ connect(playSelectedB, &QPushButton::clicked, this, &RandomTab::playSelected);
QVBoxLayout *playL = new QVBoxLayout;
- playL->addWidget(mPlaySelected);
- playL->addWidget(mPlayAll);
+ playL->addWidget(playSelectedB);
+ playL->addWidget(playAllB);
playBox->setLayout(playL);
QWidget *leftWidget = new QWidget;
@@ -132,7 +132,7 @@ void RandomTab::setupGui(){
mFileView->setRootIsDecorated(false);
mFileView->setSelectionMode(QAbstractItemView::ExtendedSelection);
mFileView->setSelectionBehavior(QAbstractItemView::SelectRows);
- connect(mFileView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(playDoubleclicked(QModelIndex)));
+ connect(mFileView, &RandomFileView::doubleClicked, this, &RandomTab::playDoubleclicked);
mFileModel = new QStandardItemModel;
mFileProxy = new QSortFilterProxyModel;
mFileProxy->setSourceModel(mFileModel);
diff --git a/randomtab.h b/randomtab.h
index 790a4e6..03dfba9 100644
--- a/randomtab.h
+++ b/randomtab.h
@@ -65,11 +65,6 @@ class RandomTab : public QWidget {
QComboBox *mActor3;
QVector<QComboBox*> mActorBoxes;
QLineEdit *mNumber;
- QPushButton *mSelect;
- QPushButton *mClear;
- QPushButton *mRefresh;
- QPushButton *mPlaySelected;
- QPushButton *mPlayAll;
RandomFileView *mFileView;
QTextEdit *mLog;
QStandardItemModel *mFileModel;