Qt Code:
  1. mLayout.setSizeConstraint(QLayout::SetFixedSize);
To copy to clipboard, switch view to plain text mode 

worked with me.

Thanks.