Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-31

shiboken.wrapInstance returns the type of object passed whereas sip.wrapinstance returns the best possible match



    • Type: Bug
    • Status: Open
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.1.0, dev
    • Fix Version/s: dev
    • Component/s: Shiboken
    • Environment:
      PySide 1.10, python 2.6 (Inside Maya2012 x64)


      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>


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            • Assignee:
              kleint Friedemann Kleint
              shrtcww Ian Jones
            • Votes:
              1 Vote for this issue
              4 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes