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

QHeaderView::setSectionResizeMode(int, QHeaderView::ResizeMode) crashes when model does not exist or has no columnCount

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.3.1, 6.8
    • Widgets: Itemviews
    • None
    • Qt 6.3.1 (through PySide6)
    • All

    Description

      Hello, I encountered this bug in PySide6, but I had some wonderful help from someone on that side of the tracker to determine this is a bug in the Qt library.

       ASSERT: "visual != -1" in file qtbase/src/widgets/itemviews/qheaderview.cpp, line 1239

      This is what they found to be the issue. The method is protected by an assertion, but that may not be sufficient.

      As the summary suggests, when a logicalIndex is given, and there is no model set, or there is but it has no columnCount set, the method crashes.

      If the columnCount is set, the value can even be outside the range [0, columnCount), and it won't crash.

      Let me know if you need more information that I am able to provide.

      The (out of scope) PySide bug report I made is here, in case you would like the minimal example I made in python 3.10.5: https://bugreports.qt.io/browse/PYSIDE-2054

      Attachments

        Issue Links

          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
              dilettante Ramses Gasque
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes