diff --git a/plugins/autotest/testcodeparser.cpp b/plugins/autotest/testcodeparser.cpp index 9270a6d4548..556fc735e2a 100644 --- a/plugins/autotest/testcodeparser.cpp +++ b/plugins/autotest/testcodeparser.cpp @@ -800,7 +800,7 @@ void TestCodeParser::scanForTests(const QStringList &fileList) return; } - QFuture future = QtConcurrent::run(&performParse, list, this); + QFuture future = Utils::runAsync(&performParse, list, this); Core::FutureProgress *progress = Core::ProgressManager::addTask(future, isFullParse ? tr("Scanning for Tests") : tr("Refreshing Tests List"), diff --git a/plugins/autotest/testrunner.cpp b/plugins/autotest/testrunner.cpp index 67f9ead4f6a..cde0dde4bfb 100644 --- a/plugins/autotest/testrunner.cpp +++ b/plugins/autotest/testrunner.cpp @@ -109,6 +109,7 @@ static void performTestRun(QFutureInterface &futureInterface, const QList selectedTests, const int timeout, const QString metricsOption) { + QEventLoop eventLoop; int testCaseCount = 0; foreach (TestConfiguration *config, selectedTests) { config->completeTestInformation(); @@ -198,7 +199,7 @@ static void performTestRun(QFutureInterface &futureInterface, emitTestResultCreated(new FaultyTestResult(Result::MessageFatal, QObject::tr("Test run canceled by user."))); } - qApp->processEvents(); + eventLoop.processEvents(); } } @@ -274,8 +275,8 @@ void TestRunner::runTests() TestResultsPane::instance(), &TestResultsPane::addTestResult, Qt::QueuedConnection); - QFuture future = QtConcurrent::run(&performTestRun, m_selectedTests, settings->timeout, - metricsOption); + QFuture future = Utils::runAsync(&performTestRun, m_selectedTests, settings->timeout, + metricsOption); Core::FutureProgress *progress = Core::ProgressManager::addTask(future, tr("Running Tests"), Autotest::Constants::TASK_INDEX);