示例#1
0
    def testSetPixmap(self):

        p1 = QPixmap(5, 5)
        p2 = QPixmap(10, 10)

        self.label.setPixmap(p1)
        self.assertIsNotNone(self.label.pixmap())

        # PYSIDE-150:
        #   When a new QPixmap is assigned to a QLabel,
        #   the previous one needs to be cleared.
        #   This means we should not keep a copy of the QPixmap
        #   on Python-side.

        # Getting pointer to the QPixmap
        ret_p = self.label.pixmap()
        self.assertIsNot(p1, ret_p)
        # Save the address of the pointer
        ret_p_addr = shiboken.getCppPointer(ret_p)
        # Remove the QPixmap
        del ret_p
        # Set new QPixmap
        self.label.setPixmap(p2)

        # There should be no pointers remaining with the same
        # address that our QPixmap p1 because it was deleted
        # using `del ret_p`
        self.assertTrue(
            all(
                shiboken.getCppPointer(o) != ret_p_addr
                for o in shiboken.getAllValidWrappers()))
    def addToolbarToGraphView(self, graphViewID, toolbar, icon=None, tooltip=None):
        """
        Add a toolbar to a graph view

        :param graphViewID: Graph view identifier
        :type graphViewID: int
        :param toolbar: Toolbar to add to the widget
        :type identifier: QToolBar
        :param toolbar: The toolbar icon
        :type identifier: QIcon
        :param tooltip: The toolbar tooltip
        :type identifier: string
        :rtype: None
        """

        action = toolbar.toggleViewAction()

        if icon:
            action.setIcon(icon)

        if tooltip:
            action.setToolTip(tooltip)

        return self.__mUiMgr.addToolbarToGraphView(
            graphViewID,
            shiboken2.getCppPointer(toolbar)[0],
            shiboken2.getCppPointer(action)[0])
示例#3
0
def unwrapinstance(object):
    """
    Unwraps objects with PySide
    """

    if python.is_python2():
        return long(shiboken.getCppPointer(object)[0])
    else:
        return int(shiboken.getCppPointer(object)[0])
示例#4
0
文件: pysideFn.py 项目: S0nic014/luna
def add_widget_to_layout(widget, control_name):
    if pm.workspaceControl(control_name, q=1, ex=1):
        if os.sys.version_info[0] >= 3:
            workspaceControlPtr = int(pma.MQtUtil.findControl(control_name))
            widgetPtr = int(getCppPointer(widget)[0])
        else:
            workspaceControlPtr = long(pma.MQtUtil.findControl(control_name))
            widgetPtr = long(getCppPointer(widget)[0])

        pma.MQtUtil.addWidgetToMayaLayout(widgetPtr, workspaceControlPtr)
示例#5
0
 def _registerWindow(self, window, nameChangedSignal):
     act = QAction("<unnamed>", self)
     act.setCheckable(True)
     act.toggled.connect(window.setVisible)
     window.visibleChanged.connect(act.setChecked)
     nameChangedSignal.connect(act.setText)
     self.windows[shiboken2.getCppPointer(window)[0]] = act  # pylint: disable=no-member
     self.menu.addAction(act)
     logger.debug("Registering window %s, new len=%d",
                  shiboken2.getCppPointer(window), len(self.windows))  # pylint: disable=no-member
     window.destroyed.connect(self._windowDestroyed)
示例#6
0
        def shouldBeVisible(self, view_frame):
            if not view_frame:
                return False

            import shiboken2 as shiboken
            vf_ptr = shiboken.getCppPointer(view_frame)[0]
            return self._visible_for_view[vf_ptr]
示例#7
0
    def __init__(self, item, parent):
        super(Override, self).__init__(parent=parent)
        self.path = None
        self.attributeUI = None
        self.item = weakref.ref(item)

        layout = QVBoxLayout()
        layout.setObjectName('override_vertical_box_layout')
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(utils.dpiScale(2))
        self._setupMainOverrideGroupBox(layout)

        self.setLayout(layout)

        # Unwrap the layout into a pointer to be able to get the UI name.
        # We use fullName() to ensure a unique name is used
        layoutName = mui.MQtUtil.fullName(long(getCppPointer(layout)[0]))
        cmds.setParent(layoutName)

        self._uiLayout = cmds.columnLayout(adjustableColumn=True)

        self._dropBoxInit()

        if item.isUniqueOverride():
            self.target = QLabel(kAppliedToUnique % item.targetNodeName())
            self.target.setAlignment(Qt.AlignBottom | Qt.AlignCenter)
            layout.addWidget(self.target)
示例#8
0
def array2d_to_qpolygonf(xdata, ydata):
    """
    Utility function to convert two 1D-NumPy arrays representing curve data 
    (X-axis, Y-axis data) into a single polyline (QtGui.PolygonF object). 
    This feature is compatible with PyQt4, PyQt5 and PySide2 (requires QtPy).
    
    License/copyright: MIT License © Pierre Raybaut 2020.
    
    :param numpy.ndarray xdata: 1D-NumPy array (numpy.float64)
    :param numpy.ndarray ydata: 1D-NumPy array (numpy.float64)
    :return: Polyline
    :rtype: QtGui.QPolygonF
    """
    dtype = np.float
    if not (xdata.size == ydata.size == xdata.shape[0] == ydata.shape[0]
            and xdata.dtype == ydata.dtype == dtype):
        raise ValueError(
            "Arguments must be 1D, float64 NumPy arrays with same size")
    size = xdata.size
    polyline = QPolygonF(size)
    if PYSIDE2:  # PySide2 (obviously...)
        address = shiboken2.getCppPointer(polyline.data())[0]
        buffer = (ctypes.c_double * 2 * size).from_address(address)
    else:  # PyQt4, PyQt5
        buffer = polyline.data()
        buffer.setsize(2 * size * np.finfo(dtype).dtype.itemsize)
    memory = np.frombuffer(buffer, dtype)
    memory[:(size - 1) * 2 + 1:2] = xdata
    memory[1:(size - 1) * 2 + 2:2] = ydata
    return polyline
示例#9
0
def getCmdsFromMenu(qMenu, parentMenu, outDict):
    """Retrieve a dictionary containing the information of all the Maya tools.

    Args:
        qMenu (QMenu): The menu to be inspected.
        parentMenu (qMenu): The parent of the qMenu.
        outDict (OrderedDict): The output dictionary containing all the data.
    """
    filterList = kMayaToolsFilter
    for menuItem in qMenu.children():
        if isinstance(menuItem, QtWidgets.QMenu):
            if not any(filt in menuItem.title() for filt in filterList):
                menuItem.aboutToShow.emit()
                keyName = getFullPathItem(menuItem)[0]
                del outDict[keyName]
                getCmdsFromMenu(menuItem, parentMenu, outDict)
        elif isinstance(menuItem, QtWidgets.QWidgetAction):
            if not any(filt in menuItem.text() for filt in filterList):
                if not menuItem.isSeparator():
                    mMenuItem = omui1.MQtUtil.fullName(long(shiboken2.getCppPointer(menuItem)[0]))
                    toolInfo = OrderedDict()
                    keyName, path = getFullPathItem(menuItem)
                    toolInfo["name"] = menuItem.text()
                    toolInfo["info"] = menuItem.toolTip()
                    toolInfo["category"] = path[0]
                    doubleCmd = getInfoFromMenuItem(mMenuItem, toolInfo)
                    if doubleCmd is not None:
                        outDict.items()[-1][1]["doubleCommand"] = doubleCmd
                    else:
                        outDict[keyName] = toolInfo
def main(docked=True):
    global PyForm
    PyForm = DirectRetargetingWindow()

    if docked is True:
        PyForm.close()
        ptr = apiUI.MQtUtil.mainWindow()
        if ptr is not None:
            main_window = shiboken2.wrapInstance(long(ptr), QtWidgets.QWidget)
        PyForm.MainWindow = PyForm.loadUiWidget(PyForm.uiFilePath)
        PyForm.layout().addWidget(PyForm.MainWindow)
        PyForm.connectSignals()
        PyForm.setParent(main_window)
        size = PyForm.size()

        name = apiUI.MQtUtil.fullName(long(shiboken2.getCppPointer(PyForm)[0]))
        dock = mc.dockControl(allowedArea=['right', 'left'],
                              area='right',
                              floating=False,
                              content=name,
                              width=size.width(),
                              height=size.height(),
                              label='Direct Facial Retargeting UI')

        widget = apiUI.MQtUtil.findControl(dock)
        dock_widget = shiboken2.wrapInstance(long(widget), QtCore.QObject)
        PyForm.connectDockWidget(dock, dock_widget)
    PyForm.show()
示例#11
0
def unwrap_instance(qt_object):
    '''Return pointer address for qt class instance
    '''
    if globals().has_key('sip'):
        return long(sip.unwrapinstance(qt_object))
    elif globals().has_key('shiboken'):
        return long(shiboken.getCppPointer(qt_object)[0])
示例#12
0
    def _get_dialog_parent(self):
        """
        Get the QWidget parent for all dialogs created through :meth:`show_dialog` :meth:`show_modal`.

        :return: QT Parent window (:class:`PySide.QtGui.QWidget`)
        """
        # Older versions of Max make use of special logic in _create_dialog
        # to handle window parenting. If we can, though, we should go with
        # the more standard approach to getting the main window.
        if self._max_version_to_year(self._get_max_version()) > 2020:
            # getMAXHWND returned a float instead of a long, which was completely
            # unusable with PySide in 2017 to 2020, but starting 2021
            # we can start using it properly.
            # This logic was taken from
            # https://help.autodesk.com/view/3DSMAX/2020/ENU/?guid=__developer_creating_python_uis_html
            import shiboken2
            from sgtk.platform.qt import QtGui

            widget = QtGui.QWidget.find(pymxs.runtime.windows.getMAXHWND())
            return shiboken2.wrapInstance(
                shiboken2.getCppPointer(widget)[0], QtGui.QMainWindow)
        elif self._max_version_to_year(self._get_max_version()) > 2017:
            #
            return MaxPlus.GetQMaxMainWindow()
        else:
            return super(MaxEngine, self)._get_dialog_parent()
示例#13
0
def unwrapinstance(obj):
    """
    Unwraps given object from a Qt object
    :param obj: QObject
    :return:
    """

    return long(shiboken.getCppPointer(obj)[0])
示例#14
0
def unwrapinstance(*args, **kwargs):
    try:
        import shiboken2
    except Exception as e:
        raise ImportError(
            'This method can not be executed without shiboken2 module.\n{0}'.
            format(e))
    return shiboken2.getCppPointer(*args, **kwargs)[0]
示例#15
0
    def __init__(self, parent=getMayaWindow()):
        self.closeExistingWindow()
        super(skinWrangler, self).__init__(parent)

        self.setupUi(self)
        self.setWindowTitle(self.title)

        wName = openMayaUI.MQtUtil.fullName(
            long(shiboken.getCppPointer(self)[0]))

        ## Connect UI
        ########################################################################
        self.refreshBTN.clicked.connect(self.refreshUI)

        #selection buttons
        self.selShellBTN.clicked.connect(self.selShellFn)
        self.selGrowBTN.clicked.connect(self.selGrowFn)
        self.selShrinkBTN.clicked.connect(self.selShrinkFn)
        self.selLoopBTN.clicked.connect(self.selLoopFn)
        self.selPointsEffectedBTN.clicked.connect(self.selPointsEffectedFn)

        #weight buttons
        self.weightZeroBTN.clicked.connect(self.weightZeroFn)
        self.weightHalfBTN.clicked.connect(self.weightHalfFn)
        self.weightFullBTN.clicked.connect(self.weightFullFn)
        self.setWeightBTN.clicked.connect(self.setWeightFn)
        self.plusWeightBTN.clicked.connect(self.plusWeightFn)
        self.minusWeightBTN.clicked.connect(self.minusWeightFn)
        self.copyBTN.clicked.connect(self.copyFn)
        self.pasteBTN.clicked.connect(self.pasteFn)
        self.selectVertsWithInfBTN.clicked.connect(self.selectVertsWithInfFn)
        self.setAverageWeightBTN.clicked.connect(self.setAverageWeightFn)

        #callbacks on state change
        self.jointLST.itemSelectionChanged.connect(self.jointListSelChanged)
        self.listAllCHK.stateChanged.connect(self.listAllChanged)
        self.nameSpaceCHK.stateChanged.connect(self.cutNamespace)
        self.skinNormalCMB.currentIndexChanged.connect(self.skinNormalFn)

        #tree filter
        self.filterLINE.returnPressed.connect(self.refreshUI)
        self.filterBTN.clicked.connect(self.refreshUI)

        #SKIN UTILS TAB:
        self.clampInfBTN.clicked.connect(self.clampInfFn)
        self.bindPoseBTN.clicked.connect(self.bindPoseFn)
        self.removeUnusedBTN.clicked.connect(self.removeUnusedFn)
        self.addJntBTN.clicked.connect(self.addJntFn)

        #TOOLS TAB
        self.jointOnBboxCenterBTN.clicked.connect(self.jointOnBboxCenterFn)
        self.rigidShellsBtn.clicked.connect(self.rigidShellsFn)

        self.scriptJobNum = cmds.scriptJob(
            e=['SelectionChanged', 'skinWranglerWindow.refreshUI()'], kws=1)
        print 'skinWrangler initialized as', wName, 'scriptJob:', self.scriptJobNum
        self.refreshUI()
示例#16
0
文件: pyside2.py 项目: jonike/Uni-Qt
def unwrapinstance(*args, **kwargs):

    try:
        import shiboken2
    except ImportError:
        raise RuntimeError(
            "This method isn't executable without shiboken2 module.")

    return shiboken2.getCppPointer(*args, **kwargs)[0]
示例#17
0
def qt_to_maya(widget):
    """
    :param QWidget widget: QWidget of a maya ui object
    :return: Maya path of parsed QWidget
    :rtype: str
    """
    ptr = shiboken2.getCppPointer(widget)[0]
    ptr = integer_types[-1](ptr)
    return OpenMayaUI.MQtUtil.fullName(ptr)
示例#18
0
def qt_to_maya(widget, *args, **kwargs):
    """
	QWidget to Maya name

	:param QWidget widget:  QWidget of a maya ui object
	:return:                Maya name of parsed QWidget
	:rtype:                 str
	"""
    return OpenMayaUI.MQtUtil.fullName(long(shiboken.getCppPointer(widget)[0]))
示例#19
0
    def addWidgetToLayout(self, widget):
        if widget:
            self.widget = widget
            self.widget.setAttribute(QtCore.Qt.WA_DontCreateNativeAncestors)

            WorkspaceController_ptr = long(omui.MQtUtil.findControl(self.name))
            widget_ptr = long(getCppPointer(self.widget)[0])

            omui.MQtUtil.addWidgetToMayaLayout(widget_ptr,
                                               WorkspaceController_ptr)
示例#20
0
        def notifyViewChanged(self, view_frame):
            if not view_frame:
                self._active_view = None
                return

            import shiboken2 as shiboken
            self._active_view = shiboken.getCppPointer(view_frame)[0]
            if self.visible:
                dock_handler = DockHandler.getActiveDockHandler()
                dock_handler.setVisible(self.m_name, True)
示例#21
0
    def on_create_view_pane_widget(parameters):
        params = azlmbr.qt.QtForPythonRequestBus(azlmbr.bus.Broadcast, "GetQtBootstrapParameters")
        editor_id = QtWidgets.QWidget.find(params.mainWindowId)
        editor_main_window = wrapInstance(int(getCppPointer(editor_id)[0]), QtWidgets.QMainWindow)
        dock_main_window = editor_main_window.findChild(QtWidgets.QMainWindow)

        # Create the view pane widget parented to the Editor QMainWindow, so it can be found
        new_widget = widget_type(dock_main_window)

        return new_widget.winId()
示例#22
0
    def __init__(self, parent=getMayaWindow()):
        self.closeExistingWindow()
        super(skinWrangler, self).__init__(parent)
        
        self.setupUi(self)
        self.setWindowTitle(self.title)
        
        wName = openMayaUI.MQtUtil.fullName(long(shiboken.getCppPointer(self)[0]))

        ## Connect UI
        ########################################################################
        self.refreshBTN.clicked.connect(self.refreshUI)
        
        #selection buttons
        self.selShellBTN.clicked.connect(self.selShellFn)
        self.selGrowBTN.clicked.connect(self.selGrowFn)
        self.selShrinkBTN.clicked.connect(self.selShrinkFn)
        self.selLoopBTN.clicked.connect(self.selLoopFn)
        self.selPointsEffectedBTN.clicked.connect(self.selPointsEffectedFn)

        #weight buttons
        self.weightZeroBTN.clicked.connect(self.weightZeroFn)
        self.weightHalfBTN.clicked.connect(self.weightHalfFn)
        self.weightFullBTN.clicked.connect(self.weightFullFn)
        self.setWeightBTN.clicked.connect(self.setWeightFn)
        self.plusWeightBTN.clicked.connect(self.plusWeightFn)
        self.minusWeightBTN.clicked.connect(self.minusWeightFn)
        self.copyBTN.clicked.connect(self.copyFn)
        self.pasteBTN.clicked.connect(self.pasteFn)
        self.selectVertsWithInfBTN.clicked.connect(self.selectVertsWithInfFn)
        self.setAverageWeightBTN.clicked.connect(self.setAverageWeightFn)

        #callbacks on state change
        self.jointLST.itemSelectionChanged.connect(self.jointListSelChanged)
        self.listAllCHK.stateChanged.connect(self.listAllChanged)
        self.nameSpaceCHK.stateChanged.connect(self.cutNamespace)
        self.skinNormalCMB.currentIndexChanged.connect(self.skinNormalFn)

        #tree filter
        self.filterLINE.returnPressed.connect(self.refreshUI)
        self.filterBTN.clicked.connect(self.refreshUI)

        #SKIN UTILS TAB:
        self.clampInfBTN.clicked.connect(self.clampInfFn)
        self.bindPoseBTN.clicked.connect(self.bindPoseFn)
        self.removeUnusedBTN.clicked.connect(self.removeUnusedFn)
        self.addJntBTN.clicked.connect(self.addJntFn)
        
        #TOOLS TAB
        self.jointOnBboxCenterBTN.clicked.connect(self.jointOnBboxCenterFn)
        self.rigidShellsBtn.clicked.connect(self.rigidShellsFn)

        self.scriptJobNum = cmds.scriptJob(e=['SelectionChanged', 'skinWranglerWindow.refreshUI()'], kws=1)
        print 'skinWrangler initialized as', wName, 'scriptJob:', self.scriptJobNum
        self.refreshUI()
示例#23
0
def main():
    if MaxPlus:
        main_window = MaxPlus.GetQMaxMainWindow()
    else:
        main_window_widget = QWidget.find(int(runtime.windows.getMAXHWND()))
        main_window = shiboken2.wrapInstance(
            shiboken2.getCppPointer(main_window_widget)[0], QMainWindow)

    msg_box = QMessageBox(main_window)
    msg_box.setText('Hello World!')
    msg_box.show()
示例#24
0
 def _windowDestroyed(self, obj):
     logger.internal("_windowDestroyed")
     ptr = shiboken2.getCppPointer(obj)  # pylint: disable=no-member
     try:
         ptr = ptr[0]
     except TypeError:
         pass
     logger.debug("Deregistering window %s, old len=%d", ptr,
                  len(self.windows))
     self.windows[ptr].deleteLater()
     del self.windows[ptr]
     logger.debug("Deregistering window %s done", ptr)
示例#25
0
 def doChange(self, value):
     t = time()
     img = self.srcImg.copy()  # 复制一份
     if 'sip' in sys.modules:
         # For PyQt5
         self.dll.cold(sip.unwrapinstance(img), value)
     elif 'shiboken2' in sys.modules:
         # For PySide2
         self.dll.cold(shiboken2.getCppPointer(img)[0], value)
     self.imgLabel.setPixmap(
         QPixmap.fromImage(img).scaledToWidth(800, Qt.SmoothTransformation))
     print('use time:', time() - t)
示例#26
0
文件: util.py 项目: djdt/nanopart
def array_to_polygonf(array: np.ndarray) -> QtGui.QPolygonF:
    assert array.ndim == 2
    assert array.shape[1] == 2

    polygon = QtGui.QPolygonF(array.shape[0])

    buf = (ctypes.c_double * array.size).from_address(
        shiboken2.getCppPointer(polygon.data())[0])

    memory = np.frombuffer(buf, np.float64)
    memory[:] = array.ravel()
    return polygon
示例#27
0
    def add_widget_to_layout(self, widget):
        """ Adds widget as a child to workspace control """
        if widget:
            self.widget = widget  # save for future handling
            # do not set children as native, should speed up redraw, remove blittering
            self.widget.setAttribute(QtCore.Qt.WA_DontCreateNativeAncestors)

            workspace_control_ptr = long(omui.MQtUtil.findControl(
                self.name))  # get cpp pointer for a workspace
            widget_ptr = long(getCppPointer(self.widget)[0])

            omui.MQtUtil.addWidgetToMayaLayout(widget_ptr,
                                               workspace_control_ptr)
示例#28
0
def main():
    #get main window
    main_window_qwdgt = QtWidgets.QWidget.find(rt.windows.getMAXHWND())

    main_window = shiboken2.wrapInstance(
        shiboken2.getCppPointer(main_window_qwdgt)[0], QtWidgets.QMainWindow)

    #create ptgui
    ptdlg = gui.PTGUI(parent=main_window)

    #set and show
    ptdlg.setFloating(True)
    ptdlg.show()
    def addActionToExplorerToolbar(self, explorerID, action):
        """
        Add an action to an explorer toolbar

        :param explorerID: Explorer identifier
        :type explorerID: int
        :param action: action
        :type action: QAction
        :rtype: None
        """
        return self.__mUiMgr.addActionToExplorerToolbar(
            explorerID,
            shiboken2.getCppPointer(action)[0])
示例#30
0
    def __init__(self, workspace_control_name=None):
        super(MyDockableButton, self).__init__()

        self.setWindowTitle("Dockable Window")

        self.setText("My Button")

        if workspace_control_name:
            workspace_control_ptr = long(
                MQtUtil.findControl(workspace_control_name))
            widget_ptr = long(getCppPointer(self)[0])

            MQtUtil.addWidgetToMayaLayout(widget_ptr, workspace_control_ptr)
示例#31
0
def array_to_polygonf(array: np.ndarray) -> QtGui.QPolygonF:
    """Converts a numpy array of shape (n, 2) to a Qt polygon."""
    assert array.ndim == 2
    assert array.shape[1] == 2

    polygon = QtGui.QPolygonF(array.shape[0])

    buf = (ctypes.c_double * array.size).from_address(
        shiboken2.getCppPointer(polygon.data())[0]  # type: ignore
    )

    memory = np.frombuffer(buf, np.float64)
    memory[:] = array.ravel()
    return polygon
示例#32
0
def _pyside2():
    """Initialise PySide2

    These functions serve to test the existence of a binding
    along with set it up in such a way that it aligns with
    the final step; adding members from the original binding
    to Qt.py

    """

    import PySide2 as module
    _setup(module, ["QtUiTools"])

    Qt.__binding_version__ = module.__version__

    try:
        try:
            # Before merge of PySide and shiboken
            import shiboken2
        except ImportError:
            # After merge of PySide and shiboken, May 2017
            from PySide2 import shiboken2

        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                shiboken2.wrapInstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            shiboken2.getCppPointer(object)[0]

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_QtUiTools"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__qt_version__ = Qt._QtCore.qVersion()
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PySide2")
    _build_compatibility_members("PySide2")
示例#33
0
    def testDump(self):
        """Just check if dump doesn't crash on certain use cases"""
        p = ObjectType()
        obj = ObjectType(p)
        obj2 = ObjectType(obj)
        obj3 = ObjectType(obj)
        self.assertEqual(shiboken.dump(None), "Ordinary Python type.")
        shiboken.dump(obj)

        model = ObjectModel(p)
        v = ObjectView(model, p)
        shiboken.dump(v)

        m = MultipleInherited()
        shiboken.dump(m)
        self.assertEqual(len(shiboken.getCppPointer(m)), 2)

        # Don't crash even after deleting an object
        shiboken.invalidate(obj)
        shiboken.dump(obj)  # deleted
        shiboken.dump(p)    # child deleted
        shiboken.dump(obj2) # parent deleted