Add LRU cache for QTextDocument to MessageDelegateHelperText

Authored by mwolff on Mar 29 2020, 1:26 PM.

Description

Add LRU cache for QTextDocument to MessageDelegateHelperText

Instead of recreating the formatted HTML representation of a message
*and* layouting that in a QTextDocument repeatedly, introduce a
LRU cache and use it in the MessageDelegateHelperText. This patch
noticeably improves the performance of scrolling in chat rooms with
lots of code blocks or other complicated messages.

Reviewers: mlaurent, dfaure

Differential Revision: https://phabricator.kde.org/D28405

Details