aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/syntaxhighlighter.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2021-02-01 14:57:40 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2021-02-02 08:15:28 +0000
commite3ae92bc5f7c54168d53fb36b593f82654dfd0fe (patch)
tree8b8ac889cbee1db4662e11da17f087c3465f5c5f /src/plugins/texteditor/syntaxhighlighter.cpp
parent208103895303a60028e83ac29e79487dd43bd3bf (diff)
TextEditor: Use invokeMethod instead of singleShot timer with 0 delay
Use QCoreApplication::instance() as a context object for the IAssistProposal deleter. Change-Id: Idf8cd1955dca146a500da1ea036298455c8a5da1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/texteditor/syntaxhighlighter.cpp')
-rw-r--r--src/plugins/texteditor/syntaxhighlighter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp
index 5a35ce1b4f..5688fe15f7 100644
--- a/src/plugins/texteditor/syntaxhighlighter.cpp
+++ b/src/plugins/texteditor/syntaxhighlighter.cpp
@@ -34,7 +34,6 @@
#include <QTextDocument>
#include <QPointer>
-#include <qtimer.h>
#include <cmath>
@@ -310,7 +309,8 @@ void SyntaxHighlighter::setDocument(QTextDocument *doc)
if (!d->noAutomaticHighlighting) {
connect(d->doc, &QTextDocument::contentsChange, this, &SyntaxHighlighter::reformatBlocks);
d->rehighlightPending = true;
- QTimer::singleShot(0, this, &SyntaxHighlighter::delayedRehighlight);
+ QMetaObject::invokeMethod(this, &SyntaxHighlighter::delayedRehighlight,
+ Qt::QueuedConnection);
}
d->foldValidator.setup(qobject_cast<TextDocumentLayout *>(doc->documentLayout()));
}