Important: Please read the Qt Code of Conduct -

[Solved]QTableView resizeRowsToContents()

  • I have created a custom delegate that subclasses QStyledItemDelegate. I have a QTableView for which i am setting my custom delegate as


    Now the Items that are stored in the tableView varies in width and height. So i tried to use resizeRowsToContents() and resizeColumnsToContent(), but nothing changes. It does not update the tableView row and column width/height. Also if i override the sizeHint() function then also it does not work.

    Thanks for your time.

    This is how it looks "image":

    This is what i want "image":

    Edit: Did some changes and it works fine !!!!!

Log in to reply