[Twisted-Python] Twisted and Qt

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()

On Thu, 04 Aug 2005 06:58:44 -0700, Tom Brown <tom@thebrownboys.net> wrote:
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
install()
from twisted.internet import reactor, protocol from mainwindowimpl import MainWindowImpl
[snip]
If you don't install the qt reactor, when you import twisted.internet.reactor, the default reactor will be used. Jp
participants (2)
-
Jp Calderone
-
Tom Brown