[Qt-interest] resizing widgets when user resizes mainwindow

Mystical Groovy mysticalgr at gmail.com
Sun Dec 20 19:04:52 CET 2009


 Hello all,

I'd like when the user resizes the main window of my app, the widgets inside
the main window to be resized automatically too.

Ive set the sizePolicy of my main window to preferred.
all the widgets inside the main window are placed inside a tab widget which
is under the centralWidget.

this is what ive tried so far:
>
> /* i suppose that when the user resizes the window, the height changes so i tried to check it with the following : */
> if(!minimumSize().height == 800) //where 800 is the default height for the window
> {
>  tabwidget->updateGeometry();
> // centralWidget->updateGeometry();
> // setupUi(this);
> }
>
>
after posting this question at qtcentre some folks told me to use layouts in
my application to achieve that

i managed to lay out the tabwidget in my main window and when i resize the
main window the tabwidget resizes along but not the widgets inside the
tabwidget.
i tried to lay out the widgets inside the tabwidget but as before it messes
up my widget potitions and i cant set them in the way i want...

i hope you get the meaning,
any help is appreciated :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091220/fb9fe601/attachment.html 


More information about the Qt-interest-old mailing list