This is a very basic example how to load a pyqt ui file to maya with pyqt libs. In this solution you really don't need to convert your pyqt ui file a python file. You can simply load your pyqt ui.
from PyQt4 import QtCore, QtGui, uic
import maya.OpenMayaUI as mui
import sip
baseUI = "/user/foo/bar/basic.ui"
baseUIClass, baseUIWidget = uic.loadUiType(baseUI)
class Ui_MainWindow(baseUIWidget, baseUIClass):
def __init__(self,parent=None):
super(baseUIWidget, self).__init__(parent)
self.setupUi(self)
def getMayaWindow():
ptr = mui.MQtUtil.mainWindow()
return sip.wrapinstance(long(ptr), QtCore.QObject)
def mayaMain():
global maya_basicTest_window
try:
maya_basicTest_window.close()
except:
pass
maya_basicTest_window = Ui_MainWindow(getMayaWindow())
maya_basicTest_window.show()
mayaMain()