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

David Boosalis david.boosalis at gmail.com
Thu Sep 17 02:19:51 CEST 2009


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 )

On Wed, Sep 16, 2009 at 1:21 PM, Duane Hebert <spoo at flarn.com> wrote:
>
> I want to use a grid to layout some square buttons (similar to a calculator)
> but even though I set the buttons to fixed size, when shown in the grid they flatten.
> Is there a simple way to prevent this?  I'm using 4.5.1 embedded.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list