diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-04-29 13:37:36 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-05-05 07:40:08 +0000 |
commit | 37ce45c21ec443246e13c01ca344ec15c962277a (patch) | |
tree | e56dd7505dd3db36c57f9f6eab5ce58c84b94592 /src/plugins/coreplugin/outputwindow.h | |
parent | 4b0f326bd9d6b91d35c9a4729b34c80be6b82419 (diff) |
Core::OutputWindow: Prevent UI thread overload
... by splitting up huge amounts of output and feeding it to the
formatter in more digestable chunks, with event processing in between.
This prevents a UI freeze in the case that a single file emits a large
amount of diagnostics and the build tool buffers the output (as ninja
and qbs do), which therefore comes in all at once.
Apart from keeping the UI responsive, this also speeds up execution of
the build step itself, as the remaining output can now be displayed
after it has finished. If another build step is started and there is too
much output pending to flush all at once, we discard the pending output,
in order to prevent the delay to accumulate.
Fixes: QTCREATORBUG-23944
Task-number: QTCREATORBUG-22914
Change-Id: I7cfef939a85bbd13730f607b0f83c36473b0e550
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/outputwindow.h')
-rw-r--r-- | src/plugins/coreplugin/outputwindow.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h index 7bf300ebb9..d717fbe4f6 100644 --- a/src/plugins/coreplugin/outputwindow.h +++ b/src/plugins/coreplugin/outputwindow.h @@ -67,6 +67,7 @@ public: void grayOutOldContent(); void clear(); void flush(); + void reset(); void scrollToBottom(); @@ -109,6 +110,8 @@ private: QElapsedTimer m_lastMessage; void enableUndoRedo(); void filterNewContent(); + void handleNextOutputChunk(); + void handleOutputChunk(const QString &output, Utils::OutputFormat format); Internal::OutputWindowPrivate *d = nullptr; }; |