forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user