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

QTreeView crashes on colapseAll

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.2.0 Beta1
    • Widgets: Itemviews
    • None
    • 6c04c21c101b70401ad9cb08de1562dc90166e9c

    Description

      QTreeView crashes sometimes, when calling collapseAll() since 7e6fbb.

      It happens in QTreeView::sizeHintForColumn(int), when d->firstVisibleItem() (qtreeview.cpp:2859) returns "-1".
      This case is not handled in d->lastVisibleColumn() and also not in sizeHintForColumn() itself.

      In QTreeView::firstVisibleItem() the verticalScrollMode is set to QAbstractItemView::ScrollPerItem and the vbar position is at bottom.
      The maximum of the vbar is > viewItems.count().
      Workaround for me is calling scrollToTop() before collapseAll().

      It's quite easy to reproduce here, but I didn't manage to isolate the bug.

      Backtrace attached.

      Attachments

        1. backtrace.txt
          9 kB
        2. reproduce.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            martinpley Martin Pley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes