[Solved]Automatic resize to fit the elements in a Dialog
-
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 :)
-
Are you using layouts?
-
Yes. QGridLayout.
-
I'd love to hear it if it's impossible!!! please, any clue?
-
Did you try to call something like this in the slot that shows/hides the optional parts:
@
resize(sizeHint());
// or
resize(minimumSizeHint());
@ -
Thanks a lot!!! @resize(minimumSizeHint());@ did it :)
I'm grateful!