Hey all,
This my first post here. Needed some help with the PyQT system in Maya. I used the QT designer to make a .ui file. Used the pyuic4.bat file to convert it into a .py (test2.py)file :
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'test2.ui'
#
# Created: Thu Sep 24 12:19:21 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(400, 300)
self.verticalLayoutWidget = QtGui.QWidget(Form)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(210, 30, 160, 80))
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout.setObjectName("verticalLayout")
self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
self.pushButton.setObjectName("pushButton")
self.verticalLayout.addWidget(self.pushButton)
self.checkBox = QtGui.QCheckBox(self.verticalLayoutWidget)
self.checkBox.setObjectName("checkBox")
self.verticalLayout.addWidget(self.checkBox)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
self.pushButton.setText(QtGui.QApplication.translate("Form", "MyButton", None, QtGui.QApplication.UnicodeUTF8))
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
self.checkBox.setText(QtGui.QApplication.translate("Form", "CheckBox", None, QtGui.QApplication.UnicodeUTF8))
To call this file in Maya i created another file (mytest.py) :
import sys
from PyQt4 import QtCore, QtGui
from test2 import Ui_Form
import pumpThread as pt
dialog=None
class MyDialog(QtGui.QDialog,Ui_Form):
def __init__(self):
QtGui.QDialog.__init__(self)
self.setupUi( self )
def mytest():
global app
global dialog
pt.initializePumpThread()
app=QtGui.qApp
dialog = MyDialog()
dialog.show()
app.connect(app, QtCore.SIGNAL("lastWindowClosed()"),
app, QtCore.SLOT("quit()"))
This created the UI in Maya with a button and a checkbox. Now this was with the documentation shipped with Maya. Getting ahead, I needed help to on the syntax/format to say create a sphere in Maya using the button.
Thanks for the help,
Regards,
Vikram