[SOLVED]unfix a window previously fixed
-
wrote on 13 Jun 2011, 08:41 last edited by
In my application, I use an resizable window.
Sometimes, I pop up a widget. When this widget is on, I don't want the user to be able to resize the window.
For this, I use setFixedSize on the mainWindow. Until here everything works.Once the widget closes up, I would like the user to be able to resize the window again. But there's no method like setResizable of unfixedSize.
Is there a way to do it tho?
Thanks
-
wrote on 13 Jun 2011, 08:49 last edited by
[quote author="Qt Assistant" date="0"]void QWidget::setFixedSize ( const QSize & s )
Sets both the minimum and maximum sizes of the widget to s, thereby preventing it from ever growing or shrinking.
This will override the default size constraints set by QLayout.
To remove constraints, set the size to QWIDGETSIZE_MAX.
Alternatively, if you want the widget to have a fixed size based on its contents, you can call QLayout::setSizeConstraint(QLayout::SetFixedSize);
See also maximumSize and minimumSize.
[/quote] -
wrote on 13 Jun 2011, 08:52 last edited by
Did you read the docs?
"Set the size using QWIDGETSIZE_MAX ":http://doc.qt.nokia.com/4.7/qwidget.html#setFixedSize-2
-
wrote on 13 Jun 2011, 09:02 last edited by
Perfectely worked.
For the one who has the problem.
first : setFixedSize(size());
then :setMaximumSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX);
setMinimumSize(0,0);Thanks for help
1/4