How do I iterate across the columns of a QTableView so I can find the total width of the table?
-
wrote on 22 Mar 2024, 22:57 last edited by jdent
Hi,
I need to find the total width of a QTableView and size() is not giving me that so I thought I would add the width of each column.... but where are the columns of a QTableView?? There are no ColumnCount() method....
How do I find the number of columns in the tableview? -
@Axel-Spoerl How can I get the vertical scrollbar of the QTableView?
wrote on 23 Mar 2024, 16:25 last edited by mpergand@jdent said in How do I iterate across the columns of a QTableView so I can find the total width of the table?:
@Axel-Spoerl How can I get the vertical scrollbar of the QTableView?
Simply with verticalScrollBar()
cause QTableView inherits of QAbstractScrollArea ;) -
Hi,
I need to find the total width of a QTableView and size() is not giving me that so I thought I would add the width of each column.... but where are the columns of a QTableView?? There are no ColumnCount() method....
How do I find the number of columns in the tableview? -
-
@mpergand ok, all I need now is the width of the vertical scrollbar and will be able to calculate what the width of the dialog needs to be!!
@jdent
int size()
returns the actual size.
int sizeHint()
is probably what you want. It returns how wide the header view wants to be in ideal circumstances.
int sectionSizeHint(int section)
returns the size hint for a given section. -
@jdent
int size()
returns the actual size.
int sizeHint()
is probably what you want. It returns how wide the header view wants to be in ideal circumstances.
int sectionSizeHint(int section)
returns the size hint for a given section.wrote on 23 Mar 2024, 15:52 last edited by jdent@Axel-Spoerl How can I get the vertical scrollbar of the QTableView?
-
@Axel-Spoerl How can I get the vertical scrollbar of the QTableView?
wrote on 23 Mar 2024, 16:25 last edited by mpergand@jdent said in How do I iterate across the columns of a QTableView so I can find the total width of the table?:
@Axel-Spoerl How can I get the vertical scrollbar of the QTableView?
Simply with verticalScrollBar()
cause QTableView inherits of QAbstractScrollArea ;) -
3/6