[Qt-interest] square buttons that stay square in a grid

Duane Hebert spoo at flarn.com
Thu Sep 17 18:12:47 CEST 2009


"David Boosalis" <david.boosalis at gmail.com> wrote in message news:870c99310909161719q500c3526sf39cfffa4a5cb482 at mail.gmail.com...
> sp.setVerticalPolicy(QSizePolicy::Fixed);
> sp.setHorizontalPolicy(QSizePolicy::Fixed);
> QWidget::setSizePolicy (sp);
> 
> If you want widgets to grow, but keep aspect look at
> QsizePolicy::setHeightForWidth ( bool dependent )

I got it to work as I needed by setting all of the possible values in the designer - minimum size, maximum size,
geometry etc.  Just setting the size policy didn't seem to work nor setting the height for width.  In each case,
the grid seemed to flatten it.



More information about the Qt-interest-old mailing list