⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)
QTableWidget how to get number of rows in each cell
dzungng last edited by dzungng
i created a table with a given number of rows and columns. I also used setSpan() to merge some cells together.
Now i need to retrieve the number of rows and columns in each cell after merging. Is there a method to loop through all merged cells to get the data I want?
I thought of using rowCount() and columnCount() but it only works with the whole table.
Thank you all
JonB last edited by
You have to march through the cells of the table reading their
rowSpan(int row, int column)to calculate what is there including spanning.
dzungng last edited by
Thank you for your answer.
I created a table using QTableWidget. Can I use the function you recommended for QTableWidget?
JonB last edited by JonB
QTableView. That means all
QTableViewmethods are also available on a
QTableWidget. This principle is worth understanding, as it applies all over the place with
QWidgets (and other Qt derived classes).