forked from qt-creator/qt-creator
Use invokeMethod instead of single shot timer with 0 timeout
Refactor it in coreplugin. Change-Id: I6aaad1b9270a8ff8a4a0bea6a1fff806b2fe190b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include <QFont>
|
||||
#include <QThread>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
|
||||
/*!
|
||||
\class Core::MessageManager
|
||||
@@ -90,7 +89,9 @@ static void write(const QString &text, Flag flags)
|
||||
if (QThread::currentThread() == m_instance->thread())
|
||||
doWrite(text, flags);
|
||||
else
|
||||
QTimer::singleShot(0, m_instance, [text, flags] { doWrite(text, flags); });
|
||||
QMetaObject::invokeMethod(m_instance, [text, flags] {
|
||||
doWrite(text, flags);
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user