[Qt-interest] How to make a top level window unresizable?

J-P Nurmi jpnurmi at gmail.com
Wed Feb 18 07:13:39 CET 2009


On Wed, Feb 18, 2009 at 7:59 AM, Dong Tiger <idlecat511 at gmail.com> wrote:

> Hi,
>
> I am trying to make a Qt top level window unresizable, that is, user can't
> drag the border to change the window's size.
>
>
Hi,

If the window has a proper top level layout installed, you can simply set

window->layout()->setSizeConstraint(QLayout::SetFixedSize);

and it will automatically adjust to the size hint of the contents. This is a
bit more dynamic approach than using

window->setFixedSize(window->sizeHint());

--
J-P Nurmi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090218/e6d9061e/attachment.html 


More information about the Qt-interest-old mailing list