title: how to take a screenshot of a PySide widget that is a window, and include the titlebar and border
body: <p>I figured out how to take a screen capture of a widget in PySide QT, but it doesn't include nonclient areas e.g. the titlebar and border.</p>
  
  <pre><code>def screenCaptureWidget(widget, filename, fileformat='png'):
      pixmap =  QtGui.QPixmap.grabWidget(widget)
      pixmap.save(filename, fileformat)
  </code></pre>
  
  <p>Two questions:       </p>
  
  <ul>
  <li>how do I include the nonclient areas?</li>
  <li>how do I get the geometry of the window rectangle relative to its client area (0,0) point?</li>
  </ul>