[Twisted-Python] Twisted and Qt

Tom Brown tom at thebrownboys.net
Thu Aug 4 09:58:44 EDT 2005


Hi,

I am trying to write yet another internet based chess game. I am writing 
the client gui using Qt. When reactor.run() is called in the client, 
there is communication with the server. However, the main window is 
never shown. A code snippet is given below. I followed the qtdemo.py 
example. What am I missing?

Thanks,
Tom

from qt import *
from twisted.internet.qtreactor import install
from twisted.internet import reactor, protocol
from mainwindowimpl import MainWindowImpl

...

def main(server, port):
  a = QApplication(argv)
  install(a)
  chessClientFactory = ChessClientFactory()
  w = MainWindowImpl()
  w.show()
  reactor.addSystemEventTrigger('after', 'shutdown', a.quit)
  a.connect(a, SIGNAL("lastWindowClosed()"), reactor.stop)
  reactor.connectTCP(server, port, chessClientFactory)
  reactor.run()




More information about the Twisted-Python mailing list