PDA

View Full Version : A fixed size window?



adorp
23rd July 2007, 19:20
How to let a dialog or form have a FIXED size, I don't hope my enduser maximize or stretch my dialog or window. Boys, any ideas?:mad:

fullmetalcoder
23rd July 2007, 19:22
Again : Qwidget::setFixedSize() Which under Designer expands to setting both min and max size to a given value (you may also want to set the size hint as fixed...)

P.S : this very looks like double-thread to me (except for the smiley...) :p

adorp
23rd July 2007, 19:37
Thank you for the useful answer, really I appreciate your humour:o Incidentally, you're the toughest coder I've ever seen!

will49
25th July 2007, 18:48
If I may, an addition to this question:

If I want a window to auto-size itself when it is created to the minimum size that everything will fit in, but not to be adjustable in size by the user how should I do that?

I had been using this which is probably wrong:

resize(sizeHint());
setWindowFlags(Qt::Dialog|Qt::MSWindowsFixedSizeDi alogHint);

marcel
25th July 2007, 19:57
setFixedSize(sizeHint());
or if you have a top layout:
layout->setSizeConstraint(QLayout::Fixed);

Regards