How can I set the row height and Column width of a QTableView?
-
I am having text and Image in one row and other rows are having only text. I want to set the height of row to the content of the row. So I am using ui->tableView->resizeColumnsToContents();
ui->tableView->resizeRowsToContents();1)All other rows are resizing except the row which containing the image and test.
2) How to break the text in the row if its long and then set the width of column.
Please hrlp me in setting the height of rows in TableView. -
How about:
http://qt-project.org/doc/qt-4.8/qtableview.html#setRowHeight
http://qt-project.org/doc/qt-4.8/qtableview.html#setColumnWidthIf you use QTableView than you have to handle that in your model which should be based on QAbstractTableModel
If you will use QTableWidget than you can set the wrap property in QTableWidgetItem