Details
Description
Inside maya we use sip to get python objects for maya ui elements like the main window. What is great is I don't have to tell it every time what kind of object I want back and I get the best match (A QtGui.QMainWindow in this case). Which I can then pass as a parent to other calls.
However with PySide it returns exactly what we pass and nothing better, which requires us to pass the specific thing we want each time. Not a big deal but certainly less awesome.
>>> import sip
>>> from PyQt4 import QtCore as PyQt_QtCore
>>> from PyQt4 import QtGui as PyQt_QtGui
>>> import shiboken
>>> from PySide import QtCore, QtGui
>>>
>>> ptr = apiUI.MQtUtil.mainWindow()
>>> print sip.wrapinstance(long(ptr), PyQt_QtCore.QObject)
<PyQt4.QtGui.QMainWindow object at 0x000000002F6CA840>
>>> print shiboken.wrapInstance(long(ptr), QtCore.QObject)
<PySide.QtCore.QObject object at 0x000000002F7765C8>
Attachments
Issue Links
- relates to
-
PYSIDE-154 Probable bug: two wrappers can have the same C pointer address
- Open
For Gerrit Dashboard: PYSIDE-31 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
531035,6 | Split out code snippets of shibokenmodule into a separate .cpp file | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
531052,4 | Shiboken.wrapInstance(): Return existing instance (preserve ids) | dev | pyside/pyside-setup | Status: MERGED | -1 | 0 |
531599,3 | Fix refcount bug in Shiboken.wrapInstance() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |