[Twisted-Python] Twisted and Qt5

Burak Nehbit burak at nehbit.net
Sat Jul 20 06:04:38 MDT 2013


Hi,

I have a question and a general guidance request on handling Qt and Twisted together. This is nearly as much a Qt question as it is a Twisted one, so I apologise in advance if this is off–topic.

To give a little bit of a background, I am building a desktop GUI application which I am coding using Python and Javascript. The back–end is Python, which makes use of SQLAlchemy, Twisted and several other Python frameworks. The GUI is in Qt, currently linked to Python with PyQt, but I will probably replace it with PySide before release. I am using Qt to draw a QtWebkit frame, in which I run Angular JS to serve up my visual interface, plus a host of other data presentation logic. 

Which is, it turns out, quite an impasse, because if I use Qt4, the GUI of my application renders in … 12 seconds. Qt5 and its version of QtWebkit loads the same thing in 300 milliseconds. I am therefore forced to use Qt5. This is how I end up with an application where both Twisted and Qt5 are essential requirements. Now, my questions are these:

1) I know there is a Qt4 reactor (which I managed to get to work and pass the twisted test suite) for Twisted. Is there such a thing for Qt5? Is it planned? 

2) In the case it's not, are there any alternatives to having a Qt5 reactor? My Twisted knowledge is still woefully inexact (I'm still reading the Twisted book), so I am not very well versed on alternative ways to accomplish this. The one way I can see is to modify the Twisted Qt4 reactor to work with Qt5, but I have almost no knowledge of C++, so this seems far–fetched.

This is my only unsolved question about my application— a project of love and learning rather than a commercial one—so if I can figure this out, I'll be well on my way. In case there is nothing to be done about this and a Qt5 reactor is an imperative, I would be willing to finance this to the best of my ability; I'm a student, but I can try to pay whatever is needed to have this reactor done, open sourced—and added to Twisted core, if desired. If there is such a project on its way, I can be a tester. If nobody is interested I would be very happy if you could give me a lead on how to make my own reactor; if I succeed I can release it as open source. Likely I am not a programmer good enough to make that happen, though! 

Qt is pretty much the only decent GUI framework in existence and almost the only way to have a Python application with a web–stack GUI, which is one of the most popular ways desktop applications are designed these days. If you know of another way to run Webkit as a Python GUI, I'd love to hear that too, but to the extent of my research this looks impossible without Qt. 

Thanks!

Best,
Burak


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130720/72fd3e6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4343 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130720/72fd3e6c/attachment.bin>


More information about the Twisted-Python mailing list