ProjectExplorer: Do not access output window from non-UI thread

Amends b4022f90d5.

Fixes: QTCREATORBUG-23442
Change-Id: I9ef369193f32b06c29f43ed7484cb120e1dfc892
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-01-08 11:18:43 +01:00
parent 1ab9dc9464
commit 4b62f2ebd3

View File

@@ -52,6 +52,7 @@
#include <QLineEdit>
#include <QLoggingCategory>
#include <QRegularExpression>
#include <QTimer>
#include <memory>
@@ -93,9 +94,11 @@ static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, cons
SynchronousProcessResponse response = cpp.runBlocking(cmdLine);
if (response.result != SynchronousProcessResponse::Finished ||
response.exitCode != 0) {
QTimer::singleShot(0, Core::MessageManager::instance(), [cmdLine, response] {
Core::MessageManager::write("Compiler feature detection failure!");
Core::MessageManager::write(response.exitMessage(cmdLine.toUserOutput(), 10));
Core::MessageManager::write(QString::fromUtf8(response.allRawOutput()));
});
return QByteArray();
}