[Twisted-Python] Problem with qt4reactor.py

IloChab ilochab at gmail.com
Mon Nov 6 07:38:03 MST 2006


I'm trying to run a simple application with Twisted and Qt4, but I get a
really strange behavior from my main script.

I can't understand if it's
a python
or a twisted
or a Qt4
problem

I'm using this reactor:
    http://twistedmatrix.com/trac/attachment/ticket/1770/qt4reactor.py

Now,
if I run this:
# >>>>>>>>>
import  qt4reactor
import sys
from PyQt4 import  QtGui
from winIum import Window

def main():
    app = QtGui.QApplication(sys.argv)
    qt4reactor.install(app)
    MainWindow = QtGui.QMainWindow()
    win = Window(MainWindow)
    MainWindow.show()
    from twisted.internet import reactor
    reactor.run()
# <<<<<<<<
my window shows and run correctly.


If I run this:
# >>>>>>>>>>>>>
import  qt4reactor
import sys
from PyQt4 import  QtGui
from winIum import Window

def creApp():
    app = QtGui.QApplication(sys.argv)
    qt4reactor.install(app)
    return app
def creWin():
    MainWindow = QtGui.QMainWindow()
    win = Window(MainWindow)
    MainWindow.show()
def main():
    app = creApp()
    creWin()
    from twisted.internet import reactor
    reactor.run()
# <<<<<<<<<<<<<
my window doesn't show and the script doesn't stop but remains trapped in
some gui loop.

What's the problem I can't see??

Thank you in advance for any help.
Licia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20061106/35fbedde/attachment.html>


More information about the Twisted-Python mailing list