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

QStandardItemModel's setItem(int row, QStandardItem *) with row 0 causes the tableView to lose header stretched attribute

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.10.1
    • Core: Item Models
    • None
    • win10, Qt 5.10.1, mingw compiler

    Description

      Hello there. today I encountered something strange and decided to send it to you to fix.

      I am using win10 with Qt 5.10.1 and mingw.

      when I try to call setItem(int row ,QStandardItem *); if the row is 0 then the ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); will be discarded. this only happens if the row number is 0.

      I have also attached a program to show the problem. if you click on 1 there will be no problem but when the 0 button is clicked then the view will not be stretched anymore.

      Goodluck

       

       

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            usefulfriend Ali Tabatabaei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes