Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1651

QSortFilterProxyModel and a sourceModel with fetchMore causes wrong expansion of indexes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.1.0
    • PySide
    • None
    • Linux/X11, Windows

      When using a `QTreeView` with a QSortFilterProxyModel, if the `sourceModel` has a `fetchMore` implemented, the items will expand automatically on a strange pattern.

       

      When selecting a 3rd level item, the 1st level item of the same row as the 3rd level item's parent will be expanded. So in the example code attached to the issue, selecting "Item #4 / Item #3 / Item #0" will expand "Item # 3" on the top level, selecting "Item #4 / Item #2 / Item #0" will expand "Item # 2" on the top level and so on.

       

      I've tested this with Python 2.7 + PySide, Python 3.7 + PySide 2.15 and 6.1 in both Windows 10 and Centos-7 all yielding the same result.

       

      There's also a Qt forum discussion about it: https://forum.qt.io/topic/128367/qabstractitemmodel-qsortfilterproxymodel-leads-to-random-item-expansion

        1. qt_random_expansion.py
          3 kB
        2. issue.mp4
          214 kB
        3. pyside1651.py
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            salvaom salvaom
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes