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

QHeaderView sectionResize does not work correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.12.2
    • Widgets: Itemviews
    • None
    • MinGW 7.3.0
    • Windows

      In Qt 5.12.2 it is not possible to resize a certain section below a certain minimum size. Up to Qt 5.9.2 this worked perfectly. The following pirctures show this bug. The first column only displays icons via the decoration role. The first column is resized to a fixed size via the following code:

      static const int Padding = 3;
      Header->setSectionResizeMode(0, QHeaderView::Fixed);
      Header->resizeSection(0, ui->tableView->iconSize().width() + 2 * Padding);

      This is the result for Qt 5.9.2

      This is the result for Qt 5.12.2

      The view always reserves a minimum size for the first column.

      The attached test case shows this problem.

       

       

        1. Qt_5.9.2.png
          Qt_5.9.2.png
          9 kB
        2. Qt_5.12.2.png
          Qt_5.12.2.png
          9 kB
        3. ItemviewColumnSizeBug.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            chehrlic Christian Ehrlicher
            ukindler Uwe Kindler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes