[Qt-interest] resize Dialog to minimum height

Torrin Jones tjones.job at gmail.com
Wed Apr 29 22:53:35 CEST 2009


On Tue, Apr 28, 2009 at 12:16 AM, Matthias Pospiech <
matthias.pospiech at gmx.de> wrote:

> I have a dialog with a tabwidget which can be enabled or disabled (hidden)
>
> If the tabwidget is hidden the dialog must not take the whole space it
> had with the tabwidget.
> It should rather be resized to minimum height. this however did not
> work. I tried the following:
>
>    if (state == Qt::Checked)
>        tabWidget_FullOptions->setHidden(false);
>    else {
>        tabWidget_FullOptions->setHidden(true);
>        this->resize(this->sizeHint().width(),
> this->minimumSizeHint().height());
>    }
>
> However the resize does not happen, or has no effect.
> So how do I resize a Dialog to its minimum height?
>
How about . . .

this->resize(1, 1);

This always works for me if I've properly layed out the window in designer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090429/de14d615/attachment.html 


More information about the Qt-interest-old mailing list