[Qt-interest] Twitching Dialog layout

Colin S. Miller no-spam-thank-you at csmiller.demon.co.uk
Sat Feb 6 15:22:37 CET 2010


Colin S. Miller wrote:

> David,
Oops, replied to the wrong person. My apologies.


> If the controls are in a grid layout, rather than a QVBoxLayout, then
> you can call setColumnMinimumWidth() with a value slightly bigger than
> the value you think largest width of the second item.
If you know what the largest string that will be displayed is, then
you can use QFontMetrics to get the size of it when rendered in a given
(or the default) font.

This is more portable when the user changes fonts.

> 
> HTH,
> Colin S. Miller




More information about the Qt-interest-old mailing list