I have many tables with this specifications:
- Number of rows 0 - ?
- Number of columns 3 - 12+
- In most columns i have only text, in many cases the last column is filled with
setCellWidget(a QFrame with one or two or three buttons)
I want:
- Manage to columns-width, row-height at first use
- Constraint the resizing at run-time (column-width, row-height) depending of the cell data.
For the first:
- I use
setColumnWidthfor every column to set the column width. This is not standard because it's depending on the screen size. For this purpose i may use a)resizeColumnToContents(int)or b)resizeColumnsToContents(). For the row height because the QFrame height is depending on the QPushButton size I use this:
counter = 0
for row in self.results:
row_height = self.main_self.ui_sound_file_search_window.table.rowHeight(counter)
self.main_self.ui_sound_file_search i_window.table.setRowHeight(counter,row_height+60)
counter = counter + 1
For the second I didn't something.
I can say that when I column is extremely resized then the text in QPushButton is cropped as you can see in the bellow image:
I use a Custom Style, but that's not the point of this question.
So what I really want is to make a QTableWidget which will have correct row-column sizes and will have constraints in column-resize, row-resize at run time by the user. This constraint will also be for horizontal header section items.
If I need to provide a minimal reproducible example, please also tell me what will be. For example a filled with data QTableWidget with no style (qss)?
