diff options
author | Simon Rettberg | 2019-06-05 14:05:02 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-06-05 14:05:02 +0200 |
commit | 4a7857f9f66cc471defe22549c7af813f844b6fc (patch) | |
tree | d25958c7298cbcd15cd99441e1d3fbaa00dd215d /src | |
parent | Remember whether help/news was open (diff) | |
download | vmchooser2-4a7857f9f66cc471defe22549c7af813f844b6fc.tar.gz vmchooser2-4a7857f9f66cc471defe22549c7af813f844b6fc.tar.xz vmchooser2-4a7857f9f66cc471defe22549c7af813f844b6fc.zip |
Use Qt5 style signal/slot connections
Diffstat (limited to 'src')
-rw-r--r-- | src/dialog.cpp | 10 | ||||
-rw-r--r-- | src/vsession.cpp | 2 | ||||
-rw-r--r-- | src/xsession.cpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp index 5e68e10..5e7a6b0 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -48,7 +48,7 @@ Dialog::Dialog(QWidget *parent) QRect desktopRect = QApplication::desktop()->availableGeometry(this); oldCenter_ = desktopRect.center(); centerTimer_ = new QTimer(this); - connect(centerTimer_, SIGNAL(timeout()), this, SLOT(onCenterTimer())); + connect(centerTimer_, &QTimer::timeout, this, &Dialog::onCenterTimer); centerTimer_->start(1000); ui->treeView->setFocusProxy(ui->filterEdit); @@ -100,8 +100,8 @@ Dialog::Dialog(QWidget *parent) // TODO: Implement bug report dialog :) ui->buttonBugReport->setEnabled(false); - QObject::connect(SessionsIconHolder::get(), SIGNAL(iconDownloaded(const QUrl&, const QIcon&)), - this, SLOT(iconDownloaded(const QUrl&, const QIcon&))); + QObject::connect(SessionsIconHolder::get(), &SessionsIconHolder::iconDownloaded, + this, &Dialog::iconDownloaded); } @@ -789,8 +789,8 @@ void Dialog::setListModel(SessionTreeModel *model) { } // reconnect the treeModel - QObject::connect(ui->treeView->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), - this, SLOT(treeView_selectionChanged(const QModelIndex&, const QModelIndex&))); + QObject::connect(ui->treeView->selectionModel(), &QItemSelectionModel::currentChanged, + this, &Dialog::treeView_selectionChanged); // select the first element, if no element is selected if (ui->treeView->selectionModel()->selectedRows().count() == 0) { diff --git a/src/vsession.cpp b/src/vsession.cpp index a4e5a7b..fec9fad 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -279,7 +279,7 @@ bool VSession::run() const { tmpfile.setAutoRemove(false); tmpfile.close(); - QObject::connect(&_process, SIGNAL(finished(int, QProcess::ExitStatus)), QApplication::instance(), SLOT(quit())); + QObject::connect(&_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), QApplication::instance(), &QCoreApplication::quit); _process.start(Config::get(Config::RUNSCRIPT), QStringList(tmpFileName)); _process.waitForStarted(10); if (_process.state() == QProcess::Starting || _process.state() == QProcess::Running) diff --git a/src/xsession.cpp b/src/xsession.cpp index 2d7214a..8e26b86 100644 --- a/src/xsession.cpp +++ b/src/xsession.cpp @@ -149,7 +149,7 @@ QIcon XSession::icon() const { bool XSession::run() const { _process->start(this->exec_); - QObject::connect(_process, SIGNAL(finished(int, QProcess::ExitStatus)), QApplication::instance(), SLOT(quit())); + QObject::connect(_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), QApplication::instance(), &QCoreApplication::quit); if (_process->state() == QProcess::Starting || _process->state() == QProcess::Running) return true; else |