Python shiboken.getCppPointer() Examples
The following are 22
code examples of shiboken.getCppPointer().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
shiboken
, or try the search function
.
Example #1
Source File: GearBox_template_1010.py From universal_tool_template.py with MIT License | 6 votes |
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 #------------------------------
Example #2
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 6 votes |
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 #------------------------------
Example #3
Source File: universal_tool_template_v8.1.py From universal_tool_template.py with MIT License | 6 votes |
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 #############################################
Example #4
Source File: universal_tool_template_0904.py From universal_tool_template.py with MIT License | 6 votes |
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 # --------------------
Example #5
Source File: universal_tool_template_0903.py From universal_tool_template.py with MIT License | 6 votes |
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 # --------------------
Example #6
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 6 votes |
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 #=======================================
Example #7
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 6 votes |
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 #=======================================
Example #8
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 6 votes |
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 #=======================================
Example #9
Source File: UITranslator.py From universal_tool_template.py with MIT License | 6 votes |
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 #############################################
Example #10
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 6 votes |
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 #=======================================
Example #11
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 6 votes |
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 #=======================================
Example #12
Source File: Qt.py From dm2skin with The Unlicense | 6 votes |
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")
Example #13
Source File: Qt.py From dm2skin with The Unlicense | 6 votes |
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")
Example #14
Source File: Qt.py From NukeToolSet with MIT License | 6 votes |
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")
Example #15
Source File: Qt.py From NukeToolSet with MIT License | 6 votes |
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")
Example #16
Source File: ui.py From maya-channel-box-plus with GNU General Public License v3.0 | 6 votes |
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] ) ) # ----------------------------------------------------------------------------
Example #17
Source File: utils.py From maya-command-search with GNU General Public License v3.0 | 5 votes |
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] ) ) # ----------------------------------------------------------------------------
Example #18
Source File: universal_tool_template_0803.py From universal_tool_template.py with MIT License | 5 votes |
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 #############################################
Example #19
Source File: universal_tool_template_v7.3.py From universal_tool_template.py with MIT License | 5 votes |
def qt_to_mui(self, qt_obj): ref = None if qtMode == 0: # ==== for pyside ==== ref = long(shiboken.getCppPointer(qt_obj)[0]) elif qtMode == 1: # ==== for PyQt==== ref = long(sip.unwrapinstance(qt_obj)) if ref is not None: return mui.MQtUtil.fullName(ref) ############################################# # window instance creation ############################################# # If you want to be able to Keep only one copy of windows ui in Maya, use code below
Example #20
Source File: uExport.py From uExport with zlib License | 4 votes |
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
Example #21
Source File: Qt.py From dm2skin with The Unlicense | 4 votes |
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")
Example #22
Source File: Qt.py From NukeToolSet with MIT License | 4 votes |
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")