Hi I’m new to the PyQt framework, and Python in general and I need some help with a few functions that are driving me crazy. I’ve tried reading through the documentation as best I could but to no avail. Here is my problem….
I have this simple input box that I would like a user to sumbit code into….
class Ui_UserCode(object):
def setupUi(self, UserCode):
UserCode.setObjectName(_fromUtf8("UserCode"))
UserCode.resize(265, 125)
UserCode.setMouseTracking(False)
self.lineEdit = QtGui.QLineEdit(UserCode)
self.lineEdit.setGeometry(QtCore.QRect(60, 50, 151, 31))
self.lineEdit.setFrame(True)
self.lineEdit.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
QtCore.QObject.connect(self.lineEdit, QtCore.SIGNAL(_fromUtf8("returnPressed()")), UserCode.returnPressed)
self.label = QtGui.QLabel(UserCode)
self.label.setGeometry(QtCore.QRect(60, 20, 151, 20))
self.label.setObjectName(_fromUtf8("label"))
self.buttonBox = QtGui.QDialogButtonBox(UserCode)
self.buttonBox.setGeometry(QtCore.QRect(40, 90, 180, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.retranslateUi(UserCode)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), UserCode.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), UserCode.reject)
QtCore.QMetaObject.connectSlotsByName(UserCode)
def retranslateUi(self, UserCode):
UserCode.setWindowTitle(_translate("UserCode", "Dialog", None))
self.label.setText(_translate("UserCode", "Please Enter User Code", None))
↧