PyQt QGridLayout question

Volker Lenhardt volker.lenhardt at
Wed Nov 23 10:35:21 CET 2005

Once again a maybe silly question, but I find no solution, neither in 
the documentation nor in examples.

I have got some different layouts to change place by the help of a 
QGridLayout in its parent widget. To make it nice I use row/col spacing 
and stretch respectively as well as multicell widgets. There is no 
problem if the layout next to come uses more rows and columns than the 
former one. But if it is the other way round, the grid seems to take 
those now unused rows and columns into account and uses more space than 

Before changing to another layout I remove and delete all widgets within 
the grid and set spacing and stretch of all used rows and columns to 0:

for c in self.gridContents.values():
for i in range(20):

Only if I do a total resection and remove the grid and the parent 
widget, too, to set them up again, all is fine but for the flicker on 
the screen. Is there a more convenient way? Remove rows/columns as can 
be done in tables?

Best wishes

Volker Lenhardt
E-Mail: volker.lenhardt at

More information about the Python-list mailing list