Simple method to disable QDialog window resize using QLayout
To disable the resizing of the window, a simple method is to use the setSizeConstraint function of the Layout.
To do this get the layout from the window first.
QDialog *myWindow = new QDialog;
QLayout *myLayout = myWindow->layout();
Then set the SizeConstraint property to fixed size using SetFixedSize enum of QLayout class. So that The window size is set to sizeHint(); it cannot be resized at all.
myLayout->setSizeConstraint(QLayout::SetFixedSize);
Done!!! :)












