标签:
1 # -*- coding: utf-8 -*- 2 3 from PyQt4 import QtCore, QtGui 4 5 try: 6 _fromUtf8 = QtCore.QString.fromUtf8 7 except AttributeError: 8 def _fromUtf8(s): 9 return s 10 11 try: 12 _encoding = QtGui.QApplication.UnicodeUTF8 13 def _translate(context, text, disambig): 14 return QtGui.QApplication.translate(context, text, disambig, _encoding) 15 except AttributeError: 16 def _translate(context, text, disambig): 17 return QtGui.QApplication.translate(context, text, disambig) 18 19 class Ui_testForm(object): 20 def setupUi(self, testForm): 21 testForm.setObjectName(_fromUtf8("testForm")) 22 testForm.resize(436, 336) 23 self.testlistWidget = QtGui.QListWidget(testForm) 24 self.testlistWidget.setGeometry(QtCore.QRect(40, 30, 231, 211)) 25 self.testlistWidget.setStyleSheet(_fromUtf8("border-color: qradialgradient(spread:repeat, cx:0.5, cy:0.5, radius:0.077, fx:0.5, fy:0.5, stop:0 rgba(0, 169, 255, 147), stop:0.497326 rgba(0, 0, 0, 147), stop:1 rgba(0, 169, 255, 147));")) 26 self.testlistWidget.setFrameShadow(QtGui.QFrame.Sunken) 27 self.testlistWidget.setObjectName(_fromUtf8("testlistWidget")) 28 self.commandLinkButton = QtGui.QCommandLinkButton(testForm) 29 self.commandLinkButton.setGeometry(QtCore.QRect(70, 260, 185, 41)) 30 self.commandLinkButton.setObjectName(_fromUtf8("commandLinkButton")) 31 32 self.retranslateUi(testForm) 33 QtCore.QMetaObject.connectSlotsByName(testForm) 34 35 def retranslateUi(self, testForm): 36 testForm.setWindowTitle(_translate("testForm", "测试窗口", None)) 37 self.commandLinkButton.setText(_translate("testForm", "命令连接按钮", None)) 38 39 if __name__ == ‘__main__‘: 40 import sys 41 42 app = QtGui.QApplication(sys.argv) 43 44 Form =QtGui.QWidget() 45 ui = Ui_testForm() 46 ui.setupUi(Form) 47 Form.show() 48 49 sys.exit(app.exec_())
标签:
原文地址:http://www.cnblogs.com/jsben/p/4896528.html