Advertisement
Guest User

simple qt example for Maya2010 - untested

a guest
Jan 10th, 2012
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. from PyQt4 import QtCore, QtGui
  2. import maya.cmds as cmds
  3. import pumpThread
  4.  
  5. class TestUi(QtGui.QDialog):
  6.     def __init__(self, parent=None):
  7.         super(TestUi, self).__init__(parent)
  8.         layout = QtGui.QHBoxLayout()
  9.         self.setLayout(layout)
  10.         self.button = QtGui.QPushButton()
  11.         self.button.setText("Qt Test Close")
  12.         layout.addWidget(self.button)
  13.         self.setWindowTitle("Test PyQt Ui")
  14.         self.connect(self.button, QtCore.SIGNAL("clicked()"), self.close)
  15.  
  16.     @staticmethod
  17.     def Display():
  18.         global form
  19.         app = QtGui.QApplication.instance()
  20.         pumpThread.initializePumpThread()
  21.         form = TestUi()
  22.         form.show()
  23.            
  24. if __name__ == "__main__":
  25.     TestUi.Display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement