def getMayaWindow(qt): ptr = omui.MQtUtil.mainWindow() if ptr is not None: if qt: #PyQt return wrp(long(ptr), QObject) else: #PySide return wrp(long(ptr), QMainWindow)
def qControl(mayaName, qobj=None): if not qobj: qobj = QObject ptr = omui.MQtUtil.findControl(mayaName) if ptr is None: ptr = omui.MQtUtil.findLayout(mayaName) if ptr is None: ptr = omui.MQtUtil.findMenuItem(mayaName) return wrp(long(ptr), qobj)
def qControl(mayaName, qobj=None): # if qt_bind == 'pyside2': # return ui.PyUI(mayaName).asQtObject() if not qobj: qobj = QObject ptr = omui.MQtUtil.findControl(mayaName) if ptr is None: ptr = omui.MQtUtil.findLayout(mayaName) if ptr is None: ptr = omui.MQtUtil.findMenuItem(mayaName) return wrp(long(ptr), qobj)
def getMayaWindow(): ptr = omui.MQtUtil.mainWindow() if ptr is not None: return wrp(long(ptr), QMainWindow)