QTableWidget how to get number of rows in each cell
-
wrote on 31 Mar 2021, 13:43 last edited by dzungng
Hi,
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
-
Hi,
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
-
wrote on 31 Mar 2021, 14:29 last edited by
Thank you for your answer.
I created a table using QTableWidget. Can I use the function you recommended for QTableWidget? -
Thank you for your answer.
I created a table using QTableWidget. Can I use the function you recommended for QTableWidget?wrote on 31 Mar 2021, 15:05 last edited by JonB@dzungng
QTableWidget
inherits fromQTableView
. That means allQTableView
methods are also available on aQTableWidget
. This principle is worth understanding, as it applies all over the place withQWidget
s (and other Qt derived classes).
1/4