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

QHeaderView::ResizeToContents should take into account the items that become visible when scrolling

    XMLWordPrintable

Details

    •  adaa50e37da1fddada874a289792a1bd95c5aebc

    Description

      When setting the QHeaderView::ResizeToContents in QTableWidget's header, only the items in the current viewport are used to resize the column width. It would be nice if it was possible to set some flag, that would allow to resize the width to fit even the items that are not visible.

      A short example reproducing the current behaviour:

      #include <QtGui>
      
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
          QTableWidget *tableWidget = new QTableWidget(255, 13);
      
          tableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
      
          QTableWidgetItem *item11 = new QTableWidgetItem("Some more words.");
          tableWidget->setItem(10, 0, item11);
      
          tableWidget->show();
          return app.exec();
      }
      

      Attachments

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

        Activity

          People

            tmartsum Thorbjørn Lund Martsum
            mpejcoch Martin Pejcoch (Inactive)
            Votes:
            9 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes