Reputation: 681
import maya.OpenMaya as om
import maya.OpenMayaUI as omUI
import sip
from PyQt4 import QtGui, QtCore, uic
import rpIcons_rc
import maya.cmds as cmds
import maya.mel as mel
def getMayaWindow():
# 'Get the maya main window as a QMainWindow instance'
ptr = omUI.MQtUtil.mainWindow()
return sip.wrapinstance(long(ptr), QtCore.QObject)
def toQtObject(mayaName):
'''
Given the name of a Maya UI element of any type,
return the corresponding QWidget or QAction.
If the object does not exist, returns None
'''
ptr = omUI.MQtUtil.findControl(mayaName)
if ptr is None:
ptr = omUI.MQtUtil.findLayout(mayaName)
if ptr is None:
ptr = omUI.MQtUtil.findMenuItem(mayaName)
if ptr is not None:
return sip.wrapinstance(long(ptr), QtCore.QObject)
uiFile = ('D:/rpGUI.ui')
form_class, base_class = uic.loadUiType(uiFile)
class myUIClass(form_class, base_class):
def __init__(self, parent=getMayaWindow()):
super(myUIClass, self).__init__(parent)
self.setupUi( self )
#methods
self.connectSignals()
def connectSignals(self):
"""Connect all the UI signals"""
print "Connect signals"
def runUI():
global app
global win
app=QtGui.qApp
win = myUIClass()
win.show()
runUI()
Above code is giving Error
So tell me wht's wrong going on ?? Thank you
Upvotes: 0
Views: 640