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

QSortFilterProxyModel::parent(...) causes SIGSEGV when filtering on a non-manually expanded QTreeView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.2.0, 6.2.1
    • Widgets: Itemviews
    • None
    • n/a
    • Linux/X11, Windows

    Description

      QSortFilterProxyModel::parent(...) causes a SIGSEGV

      Situation and how to reproduce

      The single file application in attachment main.cpp shows a dialog with a edit and tree-view.
      The tree-view has all nodes automatically expanded using a function expandTreeView(...).

      When typing the letter 's' in the edit widget the filter is applied and the SIGSEGV signal is generated.

      Omitting the expandTreeView(...) function and manually expanding each node and
      also typing the 's' character in the edit widget works just fine.

      REMARK: If an argument is added on the applications command line the 's' key press event is simulated.

      Observation

      The QTreeView::expand() method is probably messing up something but I just can't quite put my finger on it looking strolling through the source code in my debugger

      What is clear is that in: QSortFilterProxyModel::parent qsortfilterproxymodel.cpp:2211
      "it->key()" breaks and "it" is a result of "d->index_to_iterator(child)" which returns an invalid iterator.

       

      Attachments

        1. call-stack-v6.2.1.txt
          3 kB
        2. main.cpp
          7 kB
        3. screenshot.png
          screenshot.png
          41 kB
        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
            arjan Arjan van Olphen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes