gui.log: work around a Qt layout bug.

This commit is contained in:
whitequark 2016-01-16 01:26:05 +00:00
parent 85222783ee
commit 95470a59e5
1 changed files with 9 additions and 0 deletions

View File

@ -218,6 +218,15 @@ class _LogDock(dockarea.Dock):
if self.scroll_at_bottom:
self.log.scrollToBottom()
# HACK:
# If we don't do this, after we first add some rows, the "Time"
# column gets undersized and the text in it gets wrapped.
# We can call self.log.resizeColumnsToContents(), which fixes
# that problem, but now the message column is too large and
# a horizontal scrollbar appears.
# This is almost certainly a Qt layout bug.
self.log.horizontalHeader().reset()
# HACK:
# Qt intermittently likes to scroll back to the top when rows are removed.
# Work around this by restoring the scrollbar to the previously memorized