title: PySide: What is the best way to resize the main window if one widget is hidden?
body: <p>What is the best way to resize the main window automatically if one widget is hidden? I also need to resize the window if I make the widget visible again. See the images below...</p>
  
  <p>What settings should I set in Qt Designer for MainWindow (sizePolicy), centralwidget (sizePolicy, layoutSizeConstraint) and gridLayout (sizePolicy, layoutSizeConstraint) in particular?</p>
  
  <p>How can I hide the textEdit widget? <code>self.textEditObject.setVisible(False)</code> works: textEditObject is not visible, but is this the right way to resize the window?</p>
  
  <p>I think I don't understand some basic stuff, as I cannot get the desired behaviour.</p>
  
  <p><img src="https://i.stack.imgur.com/v2oF5.jpg" alt="enter image description here"></p>