# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'exa.ui'
#
# Created: Sun Sep 23 11:25:27 2012
# 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_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(665, 575)
self.
pushButton.
setGeometry(QtCore.
QRect(30,
530,
88,
27)) self.pushButton.setObjectName("pushButton")
self.
lineEdit.
setGeometry(QtCore.
QRect(220,
530,
421,
27)) self.lineEdit.setObjectName("lineEdit")
self.
graphicsView.
setGeometry(QtCore.
QRect(20,
10,
621,
451)) self.graphicsView.setObjectName("graphicsView")
self.
pushButton_2.
setGeometry(QtCore.
QRect(550,
470,
88,
27)) self.pushButton_2.setObjectName("pushButton_2")
self.retranslateUi(Form)
QtCore.
QObject.
connect(self.
pushButton, QtCore.
SIGNAL("clicked()"), self.
changeText) QtCore.
QObject.
connect(self.
pushButton_2, QtCore.
SIGNAL("clicked()"), self.
displayImage)
def retranslateUi(self, Form):
def displayImage(self):
filename
=QtGui.
QFileDialog.
getOpenFileName(Form,
"ADd file...",
"./",
("Image (*.gif *.jpeg *.jpg *.png)")) #Display image in GraphicsView I can't do this part.
def changeText(self):
if __name__ == "__main__":
import sys
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'exa.ui'
#
# Created: Sun Sep 23 11:25:27 2012
# 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_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(665, 575)
self.pushButton = QtGui.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(30, 530, 88, 27))
self.pushButton.setObjectName("pushButton")
self.lineEdit = QtGui.QLineEdit(Form)
self.lineEdit.setGeometry(QtCore.QRect(220, 530, 421, 27))
self.lineEdit.setObjectName("lineEdit")
self.graphicsView = QtGui.QGraphicsView(Form)
self.graphicsView.setGeometry(QtCore.QRect(20, 10, 621, 451))
self.graphicsView.setObjectName("graphicsView")
self.pushButton_2 = QtGui.QPushButton(Form)
self.pushButton_2.setGeometry(QtCore.QRect(550, 470, 88, 27))
self.pushButton_2.setObjectName("pushButton_2")
self.retranslateUi(Form)
QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL("clicked()"), self.changeText)
QtCore.QObject.connect(self.pushButton_2, QtCore.SIGNAL("clicked()"), self.displayImage)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("Form", "Change text", None, QtGui.QApplication.UnicodeUTF8))
self.lineEdit.setText(QtGui.QApplication.translate("Form", "awdaddwa", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_2.setText(QtGui.QApplication.translate("Form", "Add picture", None, QtGui.QApplication.UnicodeUTF8))
def displayImage(self):
filename=QtGui.QFileDialog.getOpenFileName(Form,"ADd file...","./",("Image (*.gif *.jpeg *.jpg *.png)"))
#Display image in GraphicsView I can't do this part.
def changeText(self):
self.lineEdit.setText(QtGui.QApplication.translate("Form", "Muhammed SHEMUNI", None, QtGui.QApplication.UnicodeUTF8))
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
Form = QtGui.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
Bookmarks