1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'test.ui'
#
# Created: Mon Aug 16 23:07:21 2010
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 300)
self.frame = QtGui.QFrame(Dialog)
self.frame.setGeometry(QtCore.QRect(30, 20, 331, 80))
self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
self.frame.setFrameShadow(QtGui.QFrame.Raised)
self.frame.setObjectName("frame")
self.entry_1 = QtGui.QLineEdit(self.frame)
self.entry_1.setGeometry(QtCore.QRect(120, 10, 113, 20))
self.entry_1.setObjectName("entry_1")
self.label_nom = QtGui.QLabel(self.frame)
self.label_nom.setGeometry(QtCore.QRect(60, 10, 61, 20))
self.label_nom.setObjectName("label_nom")
self.entry_2 = QtGui.QLineEdit(self.frame)
self.entry_2.setGeometry(QtCore.QRect(120, 40, 113, 20))
self.entry_2.setObjectName("entry_2")
self.bouton_go = QtGui.QPushButton(self.frame)
self.bouton_go.setGeometry(QtCore.QRect(250, 10, 75, 23))
self.bouton_go.setObjectName("bouton_go")
self.connect(self.bouton_go, SIGNAL("clicked()"), self.execute)
self.label = QtGui.QLabel(self.frame)
self.label.setGeometry(QtCore.QRect(70, 40, 46, 13))
self.label.setObjectName("label")
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
self.label_nom.setText(QtGui.QApplication.translate("Dialog", "Votre Nom :", None, QtGui.QApplication.UnicodeUTF8))
self.bouton_go.setText(QtGui.QApplication.translate("Dialog", "GO!", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Dialog", "Resultat :", None, QtGui.QApplication.UnicodeUTF8))
def execute(self):
nom=self.entry_1.text()
if nom!="":
self.entry_2.setText(nom)
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
Dialog = QtGui.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_()) |
Partager