Results 1 to 1 of 1
Hi guys, having some trouble with PyQt;
Im trying to make a simple encode/decode for ROT-13, its just a lineEdit next to a pushbutton i want it so that when ...
- 02-17-2009 #1
PyQt4 help
Hi guys, having some trouble with PyQt;
Im trying to make a simple encode/decode for ROT-13, its just a lineEdit next to a pushbutton i want it so that when i press the push button it encodes the text inside the line edit, heres what i have so far;
Any help? thanks in advance.Code:#!/usr/bin/env python #Gnu GPL malarky import sys from PyQt4 import QtCore, QtGui class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(250, 100) self.gridLayout = QtGui.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") self.lineEdit = QtGui.QLineEdit(Form) self.lineEdit.setObjectName("lineEdit") self.gridLayout.addWidget(self.lineEdit, 0, 0, 1, 1) self.pushButton = QtGui.QPushButton(Form) self.pushButton.setObjectName("pushButton") self.gridLayout.addWidget(self.pushButton, 0, 1, 1, 1) self.retranslateUi(Form) QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL("clicked()"), self.lineEdit.update) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): Form.setWindowTitle(QtGui.QApplication.translate("Form", "Encrypter", None, QtGui.QApplication.UnicodeUTF8)) self.lineEdit.setText(QtGui.QApplication.translate("Form", "ROT-13", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setToolTip(QtGui.QApplication.translate("Form", "Click to encode", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setText(QtGui.QApplication.translate("Form", "Encode", None, QtGui.QApplication.UnicodeUTF8)) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) Form = QtGui.QWidget() ui = Ui_Form() ui.setupUi(Form) Form.show() sys.exit(app.exec_())


Reply With Quote