[Qt-interest] Height of QPushButton and QLineEdit different

Jens Bache-Wiig jbache at trolltech.com
Tue Jun 9 11:54:50 CEST 2009


> I tried several things:
>
> (A:)  lineedit->setMinimumSize(button->height());
>     Didn't change anything.
>
> (B:)  lineedit->setMinimumHeight(button->height());
>       lineedit->setMaximumHeight(button->height());
>      Leads to crap, the lineedit gets a huge height,
>      I don't know why.

Make sure to call ensurepolished on the edit before querying for the size. 
Otherwise the size returned will only be calculated when you actually show 
the button.

Jens




More information about the Qt-interest-old mailing list