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
| import threading
from PyQt4 import QtCore, QtGui
class Ui_window(object):
def setupUi(self, window):
window.setObjectName("window")
window.resize(761, 591)
self.commandsHistory = QtGui.QPlainTextEdit(self.window)
self.commandsHistory.setObjectName("commandsHistory")
def printer(window):
window.emit(QtCore.SIGNAL('printReply(%s)' % row))
class Window(QtGui.QTabWidget, window.Ui_window):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setupUi(self)
self.connect(self, QtCore.SIGNAL('printReply()'),
self.commandsHistory, QtCore.SLOT('appendPlainText()'))
threading.Thread(target=getReplies, args=(self,),
name='Fetch replies').start()
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
w = Window()
w.show()
sys.exit(app.exec_()) |
Partager