I have a message source. This constantly emits signals for log messages. These log messages should be visualized in some way in the user interface. Since there are a lot messages (up to 100 per second in peak situations) this must happen quite efficiently.
For this I had 2 approaches:
Using a
QTextEdit
- This doesn't worked well. Using
insertHtml
and positioning the curser took a long time. For this the UI began to be unreponsive
- This doesn't worked well. Using
Using a a
QTableView
with an attachedQAbstractTableModel
- The data is inserted to the model. This automatically updates the view. Additionally the
dataChanged
-signal is connected toQTableView::scrollToBottom
so that always the new messages are shown.
- The data is inserted to the model. This automatically updates the view. Additionally the
Unfortunately both approaches don't work efficient enough. The second one is better but scrolling down to the bottom needs a lot of ressources.
Can someone help me with a better solution to display log messages?