Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
Last active September 5, 2017 15:04
Show Gist options
  • Save SEVEZ/014666eb3f27cd88afe8 to your computer and use it in GitHub Desktop.
Save SEVEZ/014666eb3f27cd88afe8 to your computer and use it in GitHub Desktop.
PyQT4 to PySide conversion #misc
# PyQt
from PyQt4 import QtCore, QtGui
import sip
long(sip.unwrapinstance( obj ))
sip.wrapinstance(long(ptr), QtCore.QObject)
sip.wrapinstance(long( OpenMayaUI.MQtUtil.mainWindow() ), QtCore.QObject )
# PySide
from PySide import QtGui, QtCore
import shiboken
long(shiboken.getCppPointer( obj )[0])
shiboken.wrapinstance(long(ptr), QtCore.QObject)
shiboken.wrapInstance(long( OpenMayaUI.MQtUtil.mainWindow() ), QtGui.QWidget )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment