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:
Jarek Kobus
2021-02-01 14:57:40 +01:00
parent 2081038953
commit e3ae92bc5f
4 changed files with 14 additions and 11 deletions

View File

@@ -51,7 +51,6 @@
#include <QScrollBar>
#include <QStringList>
#include <QTextCodec>
#include <QTimer>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
@@ -1014,7 +1013,8 @@ void TextDocument::removeMarkFromMarksCache(TextMark *mark)
auto scheduleLayoutUpdate = [documentLayout](){
// make sure all destructors that may directly or indirectly call this function are
// completed before updating.
QTimer::singleShot(0, documentLayout, &QPlainTextDocumentLayout::requestUpdate);
QMetaObject::invokeMethod(documentLayout, &QPlainTextDocumentLayout::requestUpdate,
Qt::QueuedConnection);
};
if (d->m_marksCache.isEmpty()) {