Use Utils::FutureSynchronizer instead of QFutureSynchronizer

Change-Id: Iecfa676f58e5ca82be7c9c94233dcc8d3654c2d7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2021-05-12 15:12:48 +02:00
parent 3823b0af5f
commit 91f136ef3a
16 changed files with 36 additions and 64 deletions

View File

@@ -568,7 +568,7 @@ void SemanticHighlighter::rerun(const QmlJSTools::SemanticInfo &semanticInfo)
auto future = Utils::runAsync(QThread::LowestPriority, &SemanticHighlighter::run,
this, semanticInfo);
m_watcher.setFuture(future);
m_futureSynchronizer.addFuture(QFuture<void>(future));
m_futureSynchronizer.addFuture(future);
}
void SemanticHighlighter::cancel()

View File

@@ -27,7 +27,7 @@
#include <qmljseditor/qmljseditor_global.h>
#include <texteditor/semantichighlighter.h>
#include <QFutureSynchronizer>
#include <utils/futuresynchronizer.h>
#include <QFutureWatcher>
#include <QTextLayout>
#include <QVector>
@@ -90,7 +90,7 @@ private:
QHash<int, QTextCharFormat> m_formats;
QHash<int, QTextCharFormat> m_extraFormats;
QVector<QTextLayout::FormatRange> m_diagnosticRanges;
QFutureSynchronizer<void> m_futureSynchronizer;
Utils::FutureSynchronizer m_futureSynchronizer;
};
} // namespace QmlJSEditor