I have a QDialog subclass that contains a spacer as its only immediate child; all of the window’s UI elements are contained in the spacer. The user cannot change the window size
void QWidget::adjustSize() Adjusts the size of the widget to fit its contents.
void QWidget::adjustSize()
Adjusts the size of the widget to fit its contents.