Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[Solved]Automatic resize to fit the elements in a Dialog
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 :)
d2uriel last edited by
Are you using layouts?
I'd love to hear it if it's impossible!!! please, any clue?
goetz last edited by
Did you try to call something like this in the slot that shows/hides the optional parts:
Thanks a lot!!! @resize(minimumSizeHint());@ did it :)