[PyQt] Understanding QGridLayout colspan

Albert Cervera i Areny albert at nan-tic.com
Mon Aug 17 14:48:27 BST 2009


A Dilluns, 17 d'agost de 2009, David Boddie va escriure:
> > (and up) the first widget (which is assigned colspan="2") uses LESS space
> > than the other two. So if we have three widgets with colspan 2, 1, 1
> > respectively the one with higher colspan is smaller than the other two!
> > Shouldn't this be the other way round? Those with higher colspan take up
> > more space?
>
> This is because the size policy of QLineEdit overrides the effect of the
> layout's management policy. You can "fix" this for the line edits in your
> example by changing their horizontal size policies in the following way:

You're right. With Preferred works, it's just that I expected three widgets 
with the same policy (even if it was expanding) would have behaved in the same 
way. It doesn't seem to have any sense the current behaviour.

-- 
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18


More information about the PyQt mailing list