This commit includes two big changes, alongside other smaller tweaks.
1) Update the internal QTextDocument of the text component directly
2) Use QPlainTextEdit, which supports HTML & is designed for long text
3) Use QString's arg function for formatting strings
Fix 1 significantly improves realtime performance when adding lines
individually, to the point that the UI no longer freezes if the viewer
is open and the log is being spammed. It also improves initial launch
speed when there's a large amount of text already in the file.
Reference: https://stackoverflow.com/a/54501760/2763321
Fix 2 completely eliminates delay when opening the viewer, regardless
of how many lines are already in the log file. For a standard log
after OBS launch, this cuts opening time from about 2 seconds to half a
second. For anything longer than 1,000 lines, the UI no longer freezes,
and the viewer (& its contents) open within half a second.
Reference: https://stackoverflow.com/a/17466240/2763321
This object should not always be created on startup. Instead, only load
it specifically when the user wants to load it.
This fixes a freeze some users were experiencing due to the text widget.
Unfortunately, it is not yet known how that freeze occurred with the log
viewer, so for the time being do not load the log viewer object unless
explicitly created.