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

QTableView::sizeHintForRow does not work correctly when rows have been moved

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.7.0
    • 4.6.2
    • Widgets: Itemviews
    • None
    • 8bde410a6d0b1510d182a365d769db182b1c07dd

      A row in a QTableView won't resize to the correct height (ie for word wrapping) if the visible column order is changed so the logicalIndex of the rightmost column is less than the logicalIndex of the leftmost column.

      void tst_QTableView::sizeHintForRow_on_moved_rows
      {
      QTableView tableView;
      QStandardItemModel model;
      model.setColumnCount(3);
      model.setRowCount(1);
      model.setData(model.index(0, 0), "Word wrapping text goes here.");
      tableView.setModel(&model);
      tableView.verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
      int orderedHeight = tableView.verticalHeader()->sectionSize(0);
      tableView.horizontalHeader()->moveSection(2, 0);
      tableView.resizeRowsToContents();
      int reorderedHeight = tableView.verticalHeader()->sectionSize(0);
      QCOMPARE(orderedHeight == reorderedHeight);
      }

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

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            noah Noah Hamerslough
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes