Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.3, 5.15.8
-
None
-
openSUSE Leap 15.5, SUSE Linux Enterprise Desktop 15 SP 4
Description
For a minimal example, please see github.com/pbielefeldt/qt_scroll_test.
What I do is, I have a QPlainTextEdit, with a scrollbar. It displays a file content. It can go out-of focus (that's what I have the two tabs for.)
Upon launch, it looks like this:
The file content is displayed correctly. When I change to tab 2, the scrollToBottom function is called as expected, and the tail of test_2.txt is displayed:
(If I changed back to tab 1, the tail of test_1.txt would be displayed as expected as well, but I don't do this right now.)
Now, a new line is added to test_1.txt. For that, I just open it in vim in another shell, and add something to the end, for example "81: hello world". I save the file.
From the debug messages in the terminal, I can see that the refreshFileContent() function was called as expected. And it itself called the scrollToBottom() function as expected. So if I change tabs now to "Test 1" again, my expectation is to see the last ~10 lines of test_1.txt, with the last line reading "81: hello world" (the string I just entered). However, it looks like this:
As you can see, the scrollbar is past its actual position. Surprisingly, just clicking the "up" button on the scrollbar once (i.e. going up ~1 line) will refresh the entire view to look like this, which is what I expected to see in the first place: