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

QTreeView crashes on colapseAll

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.2.0 Beta1
    • Fix Version/s: None
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Commits:
      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
        For Gerrit Dashboard: QTBUG-34717
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            Reporter:
            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