LogWidget: Replace QTextEdit with QPlainTextEdit for better performance

QTextEdit is heavy, similar in functionality to WordPad,
while QPlainTextEdit is lightweight like Notepad.
Qt documentation recommends using QPlainTextEdit for log viewers,
and it also allows to set automatic cutoff of oldest messages beyond a fixed point,
which we now set to MAX_LOG_LINES (5000)
This commit is contained in:
Silent
2019-08-30 23:55:40 +02:00
parent 5ea4f998c0
commit eb7d42dfe8
2 changed files with 19 additions and 17 deletions

View File

@ -14,9 +14,8 @@
class QCheckBox;
class QCloseEvent;
class QComboBox;
class QPlainTextEdit;
class QPushButton;
class QVBoxLayout;
class QTextEdit;
class QTimer;
class LogWidget final : public QDockWidget, LogListener
@ -43,9 +42,7 @@ private:
QCheckBox* m_log_wrap;
QComboBox* m_log_font;
QPushButton* m_log_clear;
QVBoxLayout* m_main_layout;
QTextEdit* m_log_text;
QWidget* m_tab_log;
QPlainTextEdit* m_log_text;
QTimer* m_timer;