コード例 #1
0
ファイル: pyqt.py プロジェクト: mgear-dev/mgear4
def maya_main_window():
    """Get Maya's main window

    Returns:
        QMainWindow: main window.

    """

    main_window_ptr = omui.MQtUtil.mainWindow()
    if PY2:
        return QtCompat.wrapInstance(long(main_window_ptr), QtWidgets.QWidget)
    return QtCompat.wrapInstance(int(main_window_ptr), QtWidgets.QWidget)
コード例 #2
0
def getMayaWindow():
    """Gets Maya main window

    Returns:
        QMainWindow: Maya window
    """
    ptr = OpenMayaUI.MQtUtil.mainWindow()
    return QtCompat.wrapInstance(long(ptr), QtWidgets.QMainWindow)
コード例 #3
0
    def connectMaya(self):
        # type: () -> None
        # script job callback
        # ptr = long(QtCompat.getCppPointer(self)[0])
        # ptr = long(QtCompat.getCppPointer(self))
        ptr = QtCompat.getCppPointer(self)

        gui = OpenMayaUI.MQtUtil.fullName(ptr)
        self.selJob = pm.scriptJob(e=("SelectionChanged", self.selectChanged),
                                   parent=gui)