summaryrefslogtreecommitdiff
path: root/src/plugins/autotest
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-02-26 09:40:49 +0100
committerhjk <hjk@qt.io>2019-02-26 15:18:14 +0000
commit6f37348b4c9f00879787374672d42ca1d14083bc (patch)
tree6196c3674e82fb5ab00a07ade44c0a509d7dc164 /src/plugins/autotest
parent44a42db1ae4460142185e429ff6b39e37d6e3623 (diff)
downloadqt-creator-6f37348b4c9f00879787374672d42ca1d14083bc.tar.gz
Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning. Also adjust coding style in the surrounding connects when needed. Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/autotest')
-rw-r--r--src/plugins/autotest/gtest/gtestoutputreader.cpp3
-rw-r--r--src/plugins/autotest/testrunner.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/autotest/gtest/gtestoutputreader.cpp b/src/plugins/autotest/gtest/gtestoutputreader.cpp
index f1efb479a4..bbeb54e3ca 100644
--- a/src/plugins/autotest/gtest/gtestoutputreader.cpp
+++ b/src/plugins/autotest/gtest/gtestoutputreader.cpp
@@ -48,8 +48,7 @@ GTestOutputReader::GTestOutputReader(const QFutureInterface<TestResultPtr> &futu
, m_projectFile(projectFile)
{
if (m_testApplication) {
- connect(m_testApplication,
- static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
+ connect(m_testApplication, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, [this] (int exitCode, QProcess::ExitStatus /*exitStatus*/) {
if (exitCode == 1 && !m_description.isEmpty()) {
createAndReportResult(tr("Running tests failed.\n %1\nExecutable: %2")
diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp
index b19e54e4c3..2f9b8b68bb 100644
--- a/src/plugins/autotest/testrunner.cpp
+++ b/src/plugins/autotest/testrunner.cpp
@@ -217,8 +217,7 @@ void TestRunner::scheduleNext()
}
m_currentProcess->setProcessEnvironment(environment.toProcessEnvironment());
- connect(m_currentProcess,
- static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
+ connect(m_currentProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, &TestRunner::onProcessFinished);
const int timeout = AutotestPlugin::settings()->timeout;
QTimer::singleShot(timeout, m_currentProcess, [this]() { cancelCurrent(Timeout); });