title: How to get maya main window pointer using PySide?
body: <p>I've used PyQt4 in maya quite a bit, and generally I've found it quite easy to switch to PySide, but I'm having trouble getting the pointer to the main window. Perhaps someone can understand what's going wrong.</p>
  
  <p>Here's what I do in PyQt4:</p>
  
  <pre><code>import sip, PyQt4.QtCore
  import maya.OpenMayaUI as mui
  ptr = mui.MQtUtil.mainWindow()
  parent = sip.wrapinstance(long(ptr), PyQt4.QtCore.QObject)
  </code></pre>
  
  <p>This works fine. When I try the same in PySide:</p>
  
  <pre><code>import sip, PySide.QtCore
  import maya.OpenMayaUI as mui
  ptr = mui.MQtUtil.mainWindow()
  parent = sip.wrapinstance(long(ptr), PySide.QtCore.QObject)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code># Error: wrapinstance() argument 2 must be sip.wrappertype, not Shiboken.ObjectType
  # Traceback (most recent call last):
  #   File "&lt;maya console&gt;", line 4, in &lt;module&gt;
  # TypeError: wrapinstance() argument 2 must be sip.wrappertype, not Shiboken.ObjectType # 
  </code></pre>
  
  <p>Anyone know what's going wrong?</p>