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

QTableView::resizeRowsToContents() not working correctly on Windows

XMLWordPrintable

    • bc49cbaab3356770eb4b27dcbc2e585bf21e9200

      QTableView::resizeRowsToContents() does not seem to be calculating the correct row height on Windows.

      Here is an example which demonstrates this:
      int main(int argc, char **argv)
      {
      QApplication a(argc, argv);

      QStandardItemModel *model = new QStandardItemModel(5, 1);
      for(int ii=0; ii<model->rowCount(); ++ii)

      { model->setData(model->index(ii,0), "one two three four five six seven eight nine ten one two three four five six seven eight nine ten"); }

      QTableView tableview;
      tableview.setModel(model);
      tableview.resizeRowsToContents();
      tableview.show();

      return a.exec();
      }

      Notice (on Windows) that the row is too small for the text and thus the text is elided.

      This does not seem to happen on X11 or Mac OSX.

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

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            gpf Shane McLaughlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes