Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Twisted Qt4 Integration
tree: 0fcfdd42a6

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


As I learned Qt, I finally understood how they want you to do things,
so this is prettty much a complete rewrite from previous versions in
the thread of development.

Everything is pretty much done with signals now.  In addition, if
you're writing a conventional Qt application and just want twisted as
an addon, you can get that by calling reactor.runReturn() instead of
run().  Run blocks, but blocks artifically.  Stoppping and rerunning
the reactor seems to work fine... Qt is the event engine that drives
it all regardless.

There is a way to run trial using a gui... in bin, there is a routine
gtrial.  Put that in the same directory as trial and it pops up a
trivial gui... hit the buton and it all runs the same... don't use the
--reactor option when calling gtrial... but all the other options
appear to work.  This was just to make sure there wasn't anything
strange with guis which there doesn't appear to be

using twisted's trial also works... make sure the qtreactor directory
is in your PYHONPATH and just use the --reactor=qt4 option

Note that if a QApplication or QCoreApplication instance isn't
constructed prior to calling reactor run, an internally owned
QCoreApplication is created and destroyed. This won't work if you call
runReturn instead of run unless you take responsibility for wacking
QCoreApplication yourself...

However, most users want this reactor to do gui stuff so this
shouldn't be an issue.

Included in this directory is a diff of trial's stdout between the
default reactor and the Qt4 reactor.  The large time differences are
due to hangage in some of the I/O tests unrelated to the performance
of the reactor itself which is very good (to be quantified... I think
its very good :-)

# trial twisted $> /tmp/select.trial
# trial --unclean-warnings --reactor=qt4 twisted &> /tmp/qt4.trial
# diff /tmp/select.trial /tmp/qt4.trial > trial.diff


Glenn H. Tarbox, PhD
Something went wrong with that request. Please try again.