[Interest] size policies, layouts, and size hints

Bill Crocker william.crocker at analog.com
Sat Mar 17 23:54:57 CET 2012

On 03/17/2012 03:09 PM, Joshua Grauman wrote:
> Hello all,
> Imagine a horizontal layout with 4 QLabels in it. The various QLabels have
> different amounts of text that can vary quite a bit and can be changed
> dynamically. I've been unable to get the horizontal layout/size policies
> to size the QLabels how I would like. What I would like is for the amount
> of 'extra' space to be divided up evenly between the QLabels. Any of the
> size policies I try end up giving extra space to the smaller QLabels
> *before* the bigger ones. I'm fine with subclassing QLabel and
> reimplementing QLabel::sizeHint() if necessary, but don't know what I
> would need to do there. Below is a picture of my situation. Thanks for any
> help.

You could write your own geometry manager derived from QLayout
and get exactly what you want.


> http://grauman.com/test.png
> Josh
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

More information about the Interest mailing list