Skip to content
Twisted Qt4 Integration
Find file
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 diff is for the full test

# trial --reactor=qt4 twisted 2>&1 | tee /tmp/qt4trial.trial 
# trial twisted 2>&1 | tee /tmp/selecttrial.trial 
# diff /tmp/select.trial /tmp/qt4.trial > qtvSelect.diff

There are significant differences in time for the full suite of tests.
Not entirely sure why yet... the profiler seems unhappy with the mail
suite and getting avatar info... but the numbers don't really add up.

If anyone has any insights...


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