PDA

View Full Version : QDialog Extensions & resizing



Bakuriu
25th October 2009, 20:50
Hello,
I've got a problem concerning the way layouts resize their widgets when dealing with QDialogs and their extensions.
I already found a solution, but it seems to be deprecated; i'm talking about the setExtension/showExtension methods,but they have the problem that the extension I want to show isn't at the bottom of the QDialog but in the middle and anyway i hate to use deprecated methods.
I read the documentation and found out that the "new way" of showing extension is by using the show/hide functions on the single QWidgets.
But I tried to do some tests and this method seems to completely fail when resizing.I tried to use any method i knew for resizing the widgets and adjusting the size of the dialog but nothing seems to work.

I mean this:
Dialog when the extension is shown:

http://img405.imageshack.us/img405/6451/schermata2o.png


Note the size of the label...
and this is when i hide it:

http://img248.imageshack.us/img248/9839/schermata3.png


As you can see the label changes his size.
What i wanted it to look like this:

http://img248.imageshack.us/img248/6779/schermata4p.png

Does anyone have a solution for this?
Thank you in advance.

Lykurg
25th October 2009, 22:12
You are searching for setSizeConstraint(QLayout::SetFixedSize). See also the article in our wiki: Expanding dialog (http://wiki.qtcentre.org/index.php?title=Expanding_dialog).

Bakuriu
26th October 2009, 07:14
Thanks a lot!
That really solves anything.