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

QTableView header width gets overridden

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.6.1
    • Widgets: Itemviews
    • None
    • Windows, Qt 6.6.1 msvc_2019
    • All
    • c1921abf65092f4732435a92732c8c11224d31fb

    Description

      Lets say you have some `QTableView` with a default section resize mode set to stretch. Now you want a specific column to have a fixed width. Example code like this:

      horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
      horizontalHeader()->setSectionResizeMode(3, QHeaderView::Fixed);
      horizontalHeader()->resizeSection(3, 20); 

      In Qt 6.6.0 this works exactly as expected with all columns stretched and column 3 having a fixed width. All versions starting from Qt 6.6.1 however have column 3 stretched aswell, ignoring the fixed width.

       

      I think the exact commit introducing this bug is 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
              razaqq Paul Lais
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes