from PyQt4.QtCore import *
from PyQt4.QtGui import *
import t_transfer # my py file obtained in step 2, shown below
class DoItNow
(QDialog, t_transfer.
t_transfer): #created my own class DoItNow, where I try to initialize the form. Not sure about this, though :) def __init__(self, parent=None):
super(DoItNow, self).__init__(parent)
self.setupUi(self)
@pyqtSignature("")
def on_pushButton_clicked(self):
a = lineEdit.text()
label.setText(a)
form = Dialog()
form.show()
app.exec_()
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import t_transfer # my py file obtained in step 2, shown below
class DoItNow(QDialog, t_transfer.t_transfer): #created my own class DoItNow, where I try to initialize the form. Not sure about this, though :)
def __init__(self, parent=None):
super(DoItNow, self).__init__(parent)
self.setupUi(self)
@pyqtSignature("")
def on_pushButton_clicked(self):
a = lineEdit.text()
label.setText(a)
app = QApplication(sys.argv)
form = Dialog()
form.show()
app.exec_()
To copy to clipboard, switch view to plain text mode
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 't_transfer.ui'
#
# Created: Wed Aug 1 00:05:17 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8
= QtCore.
QString.
fromUtf8except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(400, 300)
self.
pushButton.
setGeometry(QtCore.
QRect(230,
120,
75,
23)) self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.
lineEdit.
setGeometry(QtCore.
QRect(50,
50,
113,
18)) self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
self.
label = QtGui.
QLabel(Dialog
) self.
label.
setGeometry(QtCore.
QRect(50,
130,
111,
16)) font.setPointSize(14)
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setObjectName(_fromUtf8("label"))
self.retranslateUi(Dialog)
def retranslateUi(self, Dialog):
if __name__ == "__main__":
import sys
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 't_transfer.ui'
#
# Created: Wed Aug 1 00:05:17 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(400, 300)
self.pushButton = QtGui.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(230, 120, 75, 23))
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.lineEdit = QtGui.QLineEdit(Dialog)
self.lineEdit.setGeometry(QtCore.QRect(50, 50, 113, 18))
self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
self.label = QtGui.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(50, 130, 111, 16))
font = QtGui.QFont()
font.setPointSize(14)
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setObjectName(_fromUtf8("label"))
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("Dialog", "Do it!", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Dialog", "TextLabel", None, QtGui.QApplication.UnicodeUTF8))
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_())
To copy to clipboard, switch view to plain text mode
Bookmarks