PDA

View Full Version : How to make a QMainWindow fixed sized?



Goldmmbr
10th November 2009, 11:33
Hmm i can't seem to manage to find an elegant way of doing this... anyone have any ideeas?

yogeshgokul
10th November 2009, 11:44
Hmm i can't seem to manage to find an elegant way of doing this... anyone have any ideeas?
Just call this function with your preferred size parameters.

mainWindow->setFixedSize(200,200);

mikey33
18th November 2009, 08:52
Just to expand on what yogeshgokul mentioned and if this helps...I believe you can also do


mainWindow->setMaximumSize(200, 200);

and setMinimumSize() as well if needed depending on if you want the user to resize or minimize the window up to a certain point.

If you are using QT Creator and a .ui you can easily access these and more by right clicking the window in the designer mode and going to the "Size Constraints" option and galore you have 6 options I believe.

Hope this helps I'm kinda new hehe! ;)