From 800f966df99bda8659b52909f951eaeb6dca6cf7 Mon Sep 17 00:00:00 2001 From: thalieht Date: Thu, 10 May 2018 20:42:19 +0300 Subject: [PATCH] Use qt5 syntax for a few remaining SLOT() --- src/app/application.cpp | 2 +- src/app/main.cpp | 2 +- src/base/net/reverseresolution.cpp | 4 ++++ src/gui/mainwindow.cpp | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/application.cpp b/src/app/application.cpp index 0a421670a..7eb98c0d8 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -660,7 +660,7 @@ void Application::shutdownCleanup(QSessionManager &manager) // According to the qt docs we shouldn't call quit() inside a slot. // aboutToQuit() is never emitted if the user hits "Cancel" in // the above dialog. - QTimer::singleShot(0, qApp, SLOT(quit())); + QTimer::singleShot(0, qApp, &QCoreApplication::quit); } #endif diff --git a/src/app/main.cpp b/src/app/main.cpp index fb37fa43f..524b80036 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -329,7 +329,7 @@ void showSplashScreen() painter.drawText(224 - painter.fontMetrics().width(version), 270, version); QSplashScreen *splash = new QSplashScreen(splash_img); splash->show(); - QTimer::singleShot(1500, splash, SLOT(deleteLater())); + QTimer::singleShot(1500, splash, &QObject::deleteLater); qApp->processEvents(); } diff --git a/src/base/net/reverseresolution.cpp b/src/base/net/reverseresolution.cpp index c639e9cbc..15c593776 100644 --- a/src/base/net/reverseresolution.cpp +++ b/src/base/net/reverseresolution.cpp @@ -65,7 +65,11 @@ void ReverseResolution::resolve(const QString &ip) } else { // Actually resolve the ip +#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) + m_lookups.insert(QHostInfo::lookupHost(ip, this, &ReverseResolution::hostResolved), ip); +#else m_lookups.insert(QHostInfo::lookupHost(ip, this, SLOT(hostResolved(QHostInfo))), ip); +#endif } } diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 05a0580a1..fb18375a5 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -375,7 +375,7 @@ MainWindow::MainWindow(QWidget *parent) on_actionWarningMessages_triggered(m_ui->actionWarningMessages->isChecked()); on_actionCriticalMessages_triggered(m_ui->actionCriticalMessages->isChecked()); if (m_ui->actionSearchWidget->isChecked()) - QTimer::singleShot(0, this, SLOT(on_actionSearchWidget_triggered())); + QTimer::singleShot(0, this, &MainWindow::on_actionSearchWidget_triggered); // Auto shutdown actions QActionGroup *autoShutdownGroup = new QActionGroup(this); @@ -1213,7 +1213,7 @@ bool MainWindow::event(QEvent *e) if (!hasModalWindow) { qDebug("Minimize to Tray enabled, hiding!"); e->ignore(); - QTimer::singleShot(0, this, SLOT(hide())); + QTimer::singleShot(0, this, &QWidget::hide); return true; } }