title: How to set initial size of widget in PyQt larger than 2/3rds of screen
body: <p>In the main window I have a central widget which has a natural size, and I would like to initialize it to this size. However, I do not want it to be fixed to this size; the user should be able to shrink or expand it.</p>
  
  <p>The <a href="http://doc.qt.io/qt-5/qwidget.html#size-hints-and-size-policies" rel="nofollow">Qt documentation</a> states that:</p>
  
  <blockquote>
    <p>Note: The size of top-level widgets are constrained to 2/3 of the
    desktop's height and width. You can resize() the widget manually if
    these bounds are inadequate.</p>
  </blockquote>
  
  <p>But I am unable to use the <code>resize</code> method as prescribed.</p>
  
  <p>The following minimal example illustrates the problem: If width and height as given by <code>w</code> and <code>h</code> is less than 2/3 of that of the screen, then the window gets the expected size. If they are greater, the window gets some truncated size.</p>
  
  <pre><code>#!/usr/bin/env python
  from PyQt4 import QtCore, QtGui
  import sys
  w = 1280; h = 720
  app = QtGui.QApplication (sys.argv [1:])
  frm = QtGui.QFrame ()
  frm.sizeHint = lambda: QtCore.QSize (w, h)
  win = QtGui.QMainWindow ()
  win.setCentralWidget (frm)
  win.show ()
  sys.exit (app.exec_ ())
  </code></pre>