Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Resizeable QDialog with QStackWidget
Andaharoo last edited by
I need some layout help. I wanted a QDialog that resizes to fit contents. So the contents change and it resizes. I found I could set the widgets in the layout to an expanding size policy and then QApplication::processEvents(); adjustSize(); to get it to resize to fit the contents.
But I want to use a stackwidget in it and can't get it to work. So for example,
- Some widgets here and there
Now page 1 and 2 have different contents. And page2's minimum size is larger than page1's as it has more widgets. The widgets in the stack widget are always their minimum size in either page. Like they're supposed to be. But the widgets outside of the stack widget are only their minimum size on the largest page.
All the widgets have a vertical expanding size policy and when the page changes processEvents and adjustSize is called.
Here's a screenshot of the dialog with each page. The stackwidget is highlighted in red.
So how can I make the dialog shown on the right be minimum size? IE: The image combo box, text box, and cancel and export buttons are all larger than expected.
KillerSmath last edited by
Maybe, you can use a vertical spacer to force the minimum size of elements