I'm trying to run a simple application with Twisted and Qt4, but I get a <br>really strange behavior from my main script.<br><br>I can't understand if it's <br>a python<br>or a twisted<br>or a Qt4<br>problem<br><br>I'm using this reactor:
<br>&nbsp;&nbsp;&nbsp; <a href="http://twistedmatrix.com/trac/attachment/ticket/1770/qt4reactor.py">http://twistedmatrix.com/trac/attachment/ticket/1770/qt4reactor.py</a><br><br>Now,<br>if I run this:<br># &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
<br>import&nbsp; qt4reactor<br>import sys<br>from PyQt4 import&nbsp; QtGui<br>from winIum import Window<br><br>def main():<br>&nbsp;&nbsp;&nbsp; app = QtGui.QApplication(sys.argv)<br>&nbsp;&nbsp;&nbsp; qt4reactor.install(app)<br>&nbsp;&nbsp;&nbsp; MainWindow = QtGui.QMainWindow
()<br>&nbsp;&nbsp;&nbsp; win = Window(MainWindow)<br>&nbsp;&nbsp;&nbsp; MainWindow.show()<br>&nbsp;&nbsp;&nbsp; from twisted.internet import reactor<br>&nbsp;&nbsp;&nbsp; reactor.run()<br># &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;<br>my window shows and run correctly.<br><br><br>If I run this:
<br># &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>import&nbsp; qt4reactor<br>import sys<br>from PyQt4 import&nbsp; QtGui<br>from winIum import Window<br><br>def creApp():<br>&nbsp;&nbsp;&nbsp; app = QtGui.QApplication(sys.argv)<br>&nbsp;&nbsp;&nbsp; 
qt4reactor.install(app)<br>&nbsp;&nbsp;&nbsp; return app<br>def creWin():<br>&nbsp;&nbsp;&nbsp; MainWindow = QtGui.QMainWindow()<br>&nbsp;&nbsp;&nbsp; win = Window(MainWindow)<br>&nbsp;&nbsp;&nbsp; MainWindow.show()<br>def main():<br>&nbsp;&nbsp;&nbsp; app = creApp()<br>&nbsp;&nbsp;&nbsp; creWin()<br>&nbsp;&nbsp;&nbsp; from 
twisted.internet import reactor<br>&nbsp;&nbsp;&nbsp; reactor.run()<br># &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;<br>my window doesn't show and the script doesn't stop but remains trapped in<br>some gui loop.<br>&nbsp;<br>What's the problem I can't see??
<br><br>Thank you in advance for any help.<br>Licia