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

QTreeWidget's columns do not seem to resize properly after upgrading from Qt6.5.3 to Qt6.1.1

    XMLWordPrintable

Details

    • All
    • c1921abf6 (dev), 6b0cb9847 (6.7), 19ba32653 (6.6), 17a59b797 (tqtc/lts-6.5), 3ca0288aa (dev), 800d7138a (6.8)

    Description

      After adding some items to a QTreeWidget and loading a custom stylesheet, the interactive resize of the columns does not work.

      Default Stylesheet:

      Custom stylesheet:

      The first column is not resizing properly.

      The header is setup this way:

      header = self.header()
              header.setStretchLastSection(False)
              header.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeMode.Interactive)
              header.setSectionResizeMode(1, QtWidgets.QHeaderView.ResizeMode.ResizeToContents)
              header.setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeMode.ResizeToContents)     

      And the resizing is called like this:

      self.resizeColumnToContents(header.logicalIndex(0))

      Attached is a pyside example to reproduce the issue.

      We believe the issue was introduced with this commit:

      https://github.com/qt/qtbase/commit/4253b2b6e70ce6f2a2b5b18d9a5a230e1aa01b5e

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              axelspoerl Axel Spoerl
              esmolikowski Eric Smolikowski
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: