View Full Version : Prevent from resizing a QMainWindow
Flier
13th April 2006, 17:09
Hi !
Does anyone know how to do from Qt Designer 3.2 to prevent the user from resizing a QMainWindow ?
Thanks !
jacek
13th April 2006, 17:26
Just set the same values in minimumSize and maximumSize properties.
Flier
13th April 2006, 17:50
I've tried this but though I'm not able to enlarge the window I'm still able to reduce his size.:confused:
And how to get rid of the small triangle ?
jacek
13th April 2006, 18:02
statusBar()->setSizeGripEnabled( false );
wysota
13th April 2006, 20:08
You should also be able use setFixedSize() (if it's not defined in QDialog).
Flier
14th April 2006, 17:11
Thanks for your answers !
As it would seem one could not manage totally this from Qt Designer 3.2, I did it that way (perhaps there's a better way ?) :
I set up the maximumSize (width and height) in Qt Designer and in the code, I wrote the following :
s_max = MyQMainWin->maximumSize();
MyQMainWin->statusBar()->setSizeGripEnabled( FALSE );
MyQMainWin->show();
MyQMainWin->setFixedSize( s_max );
If setFixedSize() is placed before show(), it's still possible to shrink the Window.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.