setRowStretch() dynamically change?
-
After Creating a Grid-Layout i would like to change the setRowStretch() dynamically, when adding new Elements. How is that possible. It seems that the setRowStretch() is frozen, when i once set it and start the application.
-
Hi,
Can you share a sample code where you setup your QGridLayout and call setRowStretch ?
-
spacerItem = QSpacerItem(20,80,QSizePolicy.Minimum,QSizePolicy.Expanding)
n = self.grid.rowCount() + 1 self.grid.addItem(spacerItem, n, 1) self.grid.setRowStretch(n, n)
Theoretically, everytime i call t his function, the last element will be stretched the most right?
-
It won't make the row itself bigger, it will allow it to grow more if needed.