[PyQt] Stacking QWidgets vertically?

Henrik Pauli henrik.pauli at gmail.com
Mon Sep 21 04:50:49 BST 2009


On Monday 21 September 2009 05:33:13 Kurt Schwarz wrote:
> What would be the best way to do something like this:
> http://img15.imageshack.us/img15/5707/badpaintskills.png Where all the
> teal boxes are the same width but their height varies and they go from
> the bottom up. I have tried using a QVBoxLayout but it just spaced
> each of them out evenly.

Hmm, I think looking into sizePolicy might help:

http://doc.trolltech.com/4.5/qwidget.html#sizePolicy-prop

And also, perhaps put a SpacerItem on one end of that layout if you don't want 
the last widget to get stretched either.


More information about the PyQt mailing list