I've created several custom forms using Qt Designer. My problem is that when I open a form, its window size remains the same as the size of the window of the last form I opened. For example, let's say I open the form below and manually adjust its window size so that it fits its contents:
Then, when I open a bigger form, it will look like this:
So, if I want to see the "OK" button, I have to adjust the window size manually again. This gets tedious in the long run. I tried adding
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</sizepolicy>
at the beginning of the .ui files (before the "windowTitle" property), but it causes QGIS to crash when I try and open the forms. I also tried adding these lines:
dialog.parent().setFixedWidth(400)
dialog.parent().setFixedHeight(400)
dialog.parent().setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
at the beginning of the function that is called when the form is opened, thinking my issue was similar to this one, but it doesn't make any difference. So, how can I make the window autoresize to the contents of the custom form within?