[Twisted-Python] integrating a Qt interface with twisted, qt5, python 2.x
steven meier
commercials24 at yahoo.de
Fri Jun 17 10:26:19 MDT 2016
hi,
why does the code below print "testing..." but not "123" 5 seconds after
the application started?
import sys
from PyQt5 import QtWidgets
from untitled import Ui_MainWindow
#from webchat import get_main_page
class Main(QtWidgets.QMainWindow):
def __init__(self):
QtWidgets.QMainWindow.__init__(self)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.setupSignals()
def button_1_Clicked(self):
self.ui.textbox_2.setText(self.ui.textbox_1.text())
def setupSignals(self):
#self.ui.textbox_1.textChanged.connect(self.textbox_1_Changed)
self.ui.button_1.clicked.connect(self.button_1_Clicked)
if __name__ == '__main__':
#app = QtWidgets.QApplication(sys.argv)
app = QtWidgets.QApplication(sys.argv) # your code to init QtCore
import qt5reactor
qt5reactor.install()
print "testing..."
#get_main_page()
window = Main()
window.show()
sys.exit(app.exec_())
def printMe(argument):
print argument
def lala():
reactor.callLater(5, printMe, '123')
lala()
reactor.run()
More information about the Twisted-Python
mailing list