當前位置: 首頁>>代碼示例>>Python>>正文


Python shiboken2.getCppPointer方法代碼示例

本文整理匯總了Python中shiboken2.getCppPointer方法的典型用法代碼示例。如果您正苦於以下問題:Python shiboken2.getCppPointer方法的具體用法?Python shiboken2.getCppPointer怎麽用?Python shiboken2.getCppPointer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在shiboken2的用法示例。


在下文中一共展示了shiboken2.getCppPointer方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testAdresses

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def testAdresses(self):
        q = QtCore.QObject()
        ptr = wrapper.getCppPointer(q)
        print("CppPointer to an instance of PySide.QtCore.QObject = 0x%016X" % ptr[0])

        # None of the following is expected to raise an
        # OverflowError on 64-bit systems

        # largest 32-bit address
        wrapper.wrapInstance(0xFFFFFFFF, QtCore.QObject)

        # a regular, slightly smaller 32-bit address
        wrapper.wrapInstance(0xFFFFFFF, QtCore.QObject)

        # an actual 64-bit address (> 4 GB, the first non 32-bit address)
        wrapper.wrapInstance(0x100000000, QtCore.QObject)

        # largest 64-bit address
        wrapper.wrapInstance(0xFFFFFFFFFFFFFFFF, QtCore.QObject) 
開發者ID:coin3d,項目名稱:pivy,代碼行數:21,代碼來源:pyside_test.py

示例2: qtToMaya

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def qtToMaya(widget):
    """
    QWidget -> 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]
        ) 
    )


# ---------------------------------------------------------------------------- 
開發者ID:robertjoosten,項目名稱:maya-channel-box-plus,代碼行數:18,代碼來源:ui.py

示例3: qt_to_mui

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)
            
    #=======================================
    # widget specific functions
    #======================================= 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:18,代碼來源:universal_tool_template_1116.py

示例4: qt_to_mui

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)
            
    #------------------------------
    # TreeWidget Process Functions
    #------------------------------ 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:18,代碼來源:GearBox_template_1010.py

示例5: qt_to_mui

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

#############################################
# window instance creation
############################################# 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:18,代碼來源:UITranslator.py

示例6: qt_to_mui

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)

#############################################
# User Class creation
#############################################

# --------------------
#  user module list
# -------------------- 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:22,代碼來源:universal_tool_template_0903.py

示例7: qtToMaya

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def qtToMaya(widget):
    """
    QWidget -> 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]
        ) 
    )
    
# ---------------------------------------------------------------------------- 
開發者ID:robertjoosten,項目名稱:maya-command-search,代碼行數:17,代碼來源:utils.py

示例8: _pyside2

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
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:
        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") 
開發者ID:weijer,項目名稱:NukeToolSet,代碼行數:41,代碼來源:Qt.py

示例9: _pyqt5

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

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

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

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

    _reassign_misplaced_members("pyqt5") 
開發者ID:weijer,項目名稱:NukeToolSet,代碼行數:33,代碼來源:Qt.py

示例10: shouldBeVisible

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
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] 
開發者ID:gaasedelen,項目名稱:lighthouse,代碼行數:9,代碼來源:binja_api.py

示例11: notifyViewChanged

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
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) 
開發者ID:gaasedelen,項目名稱:lighthouse,代碼行數:12,代碼來源:binja_api.py

示例12: qt_to_mui

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def qt_to_mui(self, qt_obj):
        if hostMode != "maya":
            return
        ref = None
        if qtMode in (0,2):
            # ==== for pyside ====
            ref = long(shiboken.getCppPointer(qt_obj)[0])
        elif qtMode in (1,3):
            # ==== for PyQt====
            ref = long(sip.unwrapinstance(qt_obj))
        if ref is not None:
            return mui.MQtUtil.fullName(ref)
#############################################
# window instance creation
############################################# 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:17,代碼來源:universal_tool_template_0803.py

示例13: _pyside

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def _pyside():
    """Initialise PySide"""

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

    Qt.__binding_version__ = module.__version__

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

    except ImportError:
        pass  # Optional

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

    if hasattr(Qt, "_QtGui"):
        setattr(Qt, "QtWidgets", _new_module("QtWidgets"))
        setattr(Qt, "_QtWidgets", Qt._QtGui)

        Qt.QtCompat.setSectionResizeMode = Qt._QtGui.QHeaderView.setResizeMode

    if hasattr(Qt, "_QtCore"):
        Qt.__qt_version__ = Qt._QtCore.qVersion()
        QCoreApplication = Qt._QtCore.QCoreApplication
        Qt.QtCompat.translate = (
            lambda context, sourceText, disambiguation, n:
            QCoreApplication.translate(
                context,
                sourceText,
                disambiguation,
                QCoreApplication.CodecForTr,
                n
            )
        )

    _reassign_misplaced_members("pyside") 
開發者ID:weijer,項目名稱:NukeToolSet,代碼行數:46,代碼來源:Qt.py

示例14: __init__

# 需要導入模塊: import shiboken2 [as 別名]
# 或者: from shiboken2 import getCppPointer [as 別名]
def __init__(self, parent=getMayaWindow()):
        self.closeExistingWindow()
        super(uExportTool, self).__init__(parent)


        self.setupUi(self)
        self.setWindowTitle(self.title)
        self.fbxVerLbl.setText('fbx plugin ' + str(self.fbxVersion()) + '  ')

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

        ## Connect UI
        ########################################################################
        self.export_BTN.clicked.connect(self.export_FN)
        self.createUexportNode_BTN.clicked.connect(self.createUexportNode_FN)
        self.replaceUnknownNodes.clicked.connect(self.replaceUnknownNodes_FN)
        self.refreshBTN.clicked.connect(self.refreshUI)
        self.getTexturesP4BTN.clicked.connect(self.getTexturesP4_FN)

        # TODO: Add save settings, setting p4 menu for now
        self.p4CHK.setChecked(False)

        self.workSpaceCMB.currentIndexChanged.connect(self.workspaceSelected)

        #context menu
        self.export_tree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.export_tree.customContextMenuRequested.connect(self.openMenu)

        self.export_tree.itemClicked.connect(self.check_status)
        self.export_tree.itemClicked.connect(self.itemClicked)
        self.missingFilesTree.itemClicked.connect(self.itemClicked)


        #check for p4 lib
        yourP4Module = 'p4python.P4'
        try:
            __import__(yourP4Module)
        except ImportError:
            print 'Perforce lib not found.'
            self.perforce = False
        else:
            self.perforce = True
            print 'Perforce lib found.'

        #Connect event filter to grab right/left click
        self.export_tree.viewport().installEventFilter(self)
        self.mousePress = None

        self.snapRoot_CMB.setHidden(True)
        self.refreshUI()

## GENERAL
########################################################################

    #quick mesh check 
開發者ID:chrisevans3d,項目名稱:uExport,代碼行數:57,代碼來源:uExport.py


注:本文中的shiboken2.getCppPointer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。