PDA

View Full Version : how to set max or min height or width for main form



narlapavan
15th February 2012, 17:17
i am unable to set height and width for main form ..
my code::
QWidget wid(this); // here this reflects to main ui i.e main form
wid.setMinimumHeight(250);
wid.setMinimumWidth(250);

the above code is not working ...
what i hav to use

ChrisW67
15th February 2012, 22:51
Which do you want to do?

Set the current height and width (i.e. QWidget::resize()), or
Set minimum allowable size (i.e QWidget::setMinimumSize() and friends).

Setting the minimum size does not change the current size of the widget unless it it already smaller than the minimum.

narlapavan
16th February 2012, 13:40
Actually my aim is, if i double click on tree view ,if that file which i double clicked is with .jpg extension then i am showing that image on label, i want that ui to auto resize based on image height and width..

i tried above one it din't work