title: python qt : automatically resizing main window to fit content
body: <p>I have a main window which contains a main widget, to which a vertical layout is set. To the layout is added a <code>QTableWidget</code> only (for the moment).</p>
  
  <p>When I start the application and call show on the main_window, only part of the <code>QTableWidget</code> is shown. I can extend the window manually to see it all, but I would like the window to have its size nicely adapted to the size of the <code>QTableWidget</code>.</p>
  
  <p>Googling the question found a lot of posts on how to use resize to an arbitrary size, and call to <code>resize(int)</code> works fine, but this is not quite what I am asking </p>
  
  <p>Lots of other posts are not explicit enough, e.g "use sizePolicy" or "use <code>frameGeometry</code>" or "use geometry" or "use <code>sizeHint</code>". I am sure all of them may be right, but an example on how to would be awesome.  </p>