[Solved]Automatic resize to fit the elements in a Dialog
-
wrote on 21 Apr 2012, 18:53 last edited by
Hello guys,
I have a dialog that has some elements/controls that depending on some options gets some controls inside it to be visible or not. The problem is, when many items are invisible, the dialog looks empty, and one has to resize it (make it smaller), to make it look normal with no empty spaces in it.
I want to restore the Window size to what Qt would choose automatically to fit the elements inside the dialog. Is there such a call?
Thanks for any efforts :)
-
wrote on 21 Apr 2012, 19:51 last edited by
Are you using layouts?
-
wrote on 21 Apr 2012, 22:33 last edited by
Yes. QGridLayout.
-
wrote on 23 Apr 2012, 10:17 last edited by
I'd love to hear it if it's impossible!!! please, any clue?
-
wrote on 23 Apr 2012, 21:47 last edited by
Did you try to call something like this in the slot that shows/hides the optional parts:
@
resize(sizeHint());
// or
resize(minimumSizeHint());
@ -
wrote on 24 Apr 2012, 07:35 last edited by
Thanks a lot!!! @resize(minimumSizeHint());@ did it :)
I'm grateful!
6/6