Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116673

verticalScrollBar scrolls out-of-range on refresh event

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.3, 5.15.8
    • GUI: Text handling
    • None
    • openSUSE Leap 15.5, SUSE Linux Enterprise Desktop 15 SP 4
    • Linux/Wayland

    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:

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            p_bielefeldt Philipp Bielefeldt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes