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

QListWidget scrolls incorrectly when there are hidden items - Followup to bug: QTBUG-16831

    XMLWordPrintable

Details

    Description

      This is a followup to a closed bug

      1. QTBUG-16831

      This bug was closed due to the inability to reproduce - this was due to the issue that the user did not mention that the window in the example has to be squeezed so as to show the horizontal scroll bar at the bottom. 

      I am pasting the original message of the original bug:

      Compile and run the attached source (or run the Python script, which uses PyQt). The list widget does not exhibit expected behavior when scrolling with the keyboard (arrow keys, PgUp/PgDown, Home/End), instead appearing to jump around randomly.

      However, if the last item is selected and the up arrow key held, the list eventually starts jumping upward by multiples of 9, leading me to believe that the widget is confused about indices when there are hidden items. E.g., when going up from the item labeled 30 to the item labeled 27 (which are the 30th and 27th items inserted but are adjacent in the view because 28 and 29 are hidden) it instead goes up from the 30th visible item to the 27th visible item, thus jumping from the item labeled 90 to the item labeled 81.

      This bug was present in previous versions of Qt at least a few months ago, but I don't know the version numbers.

       

      Here are my updated notes and procedure to replicating this - and I've attached a slightly modified code. Note this uses QListWidget but this applies to QListView as well:

       

      I've attached an updated Python version - do the following steps to replicate the weird jumping/scrolling issue.

      1) Run this using either Python 2 (PyQt4) or 3 (PyQt5).

      2) When the list displays note that the horizontal scroll bar is visible 

      3) Using the vertical scroll bar scroll down to the middle of the list

      4) Click on ANY of the middle rows in that list....note that the next thing you will see if that a short second after you click on the row, the entire list will scroll down to some other row below (not necessarily all the way to the bottom). The view simply jumps.

      5) Resize the window so that the horizontal/bottom scroll bar disappears and repeat the same process

      6) Click on ANY of the middle rows in that list....note that NOTHING will scroll - ie. everything works as expected.

      7) Rinse and Repeat - you can squeeze the window again so the horizontal scroll bar appears and clicking on any of the middle rows will cause the whole list to jump down further.

       

      I'd like to add that this bug still exists in qt 5.9.5 when running via PyQt 5.10.1, and also in qt 4.8.7 when running PyQt 4.12.1.

      Attachments

        1. TestQlist2.py
          0.6 kB
          Mariusz Zaczek
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            z-knight Mariusz Zaczek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes