Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#1770 enhancement closed wontfix (wontfix)

Reactor for Qt4 using PyQt4

Reported by: grudy Owned by:
Priority: normal Milestone:
Component: core Keywords: patch
Cc: grudy, edsuom, therve, cartman Branch:
Author:

Description

Create a QT4 reactor(s) that take advantage of Qt4's new architecture and features in a efficient way. Most likely a non-GUI reactor should be created to run on headless buildbots (has no x11 dependencies) and another regular GUI reactor that uses PyQt4.QtGui. As suggested below in a mailing list correspondence I attached my fairly direct port of the QT3 reactor for use untill a new and tested is integrated into the codebase.

From: Itamar Shtull-Trauring <itamar at itamarst.org> (http://itamarst.org) On Tue, 2006-05-30 at 10:14 -0600, Gabe Rudy wrote:

Someone will have to write one. Qt4 has numerous improvements which should make it possible to write a reasonable reactor, instead of a shambling horror (like the existing Qt reactor).

I use twisted with a pyQt4 app, so I created a more or less functional port of the current qt recator to qt4. I have attached it for anybody who needs a quick fix, but I don't claim to have taken advantage of Qt4's cleaner architecture and many improvements but I have tested it on both windows and linux and it seems to work ok. You are right that there should be a GUI and non-GUI qt4 reactor options and it may not even be that hard to code if someone has the time and the tests.

Cool! Could you please open an issue in the tracker with this attached?

Attachments (2)

qt4reactor.py (5.1 KB) - added by grudy 15 years ago.
qt4reactor.2.py (5.4 KB) - added by therve 13 years ago.
Update with recent twisted/qt4

Download all attachments as: .zip

Change History (16)

Changed 15 years ago by grudy

Attachment: qt4reactor.py added

comment:1 Changed 15 years ago by Glyph

Keywords: review added
Owner: changed from Glyph to itamarst
Priority: normalhighest

Here you go, Mr. "I love QT"

I don't even know what software to install to review this. I assume that it's for review though so I'm putting it into the offical "review" state. Tag!

comment:2 Changed 15 years ago by edsuom

Cc: edsuom added

comment:3 Changed 15 years ago by Jean-Paul Calderone

Keywords: patch added; review removed
Priority: highestnormal

This is a good start, but there's no reason to include it yet. Switching to Qt4 without taking advantage of the improvements it offers will just reduce the number of people who can use the reactor without improving anything.

comment:4 Changed 15 years ago by therve

Cc: therve added

I see one advantage: the current qtreactor doesn't work for me (segfault under ubuntu dapper) whereas this one works without problem.

comment:5 Changed 15 years ago by Jean-Paul Calderone

Segfaults when doing what? The full test suite (modulo a couple known problems that are basically test bugs) passes for me on Ubuntu with the current Qt reactor.

comment:6 Changed 15 years ago by grudy

I think he means the current qt reactor does'nt work if you have PyQt4 installed, in which case it will segfault instead of more elegantly telling you that you are trying to do PyQt3 things with PyQt4 like saying from qt import *

comment:7 Changed 15 years ago by therve

You're right, my bad. I didn't think the qt4 install would break the qt3, but indeed 'from qt import *' segfault python when pyqt4 is installed.

comment:8 Changed 15 years ago by Jean-Paul Calderone

Has someone reported this eggregious defect to the PyQt4 developers? :)

comment:9 Changed 14 years ago by Jean-Paul Calderone

I can't reproduce the above mentioned segfault:

In fact, the qt package is PyQt3 and version 4 doesn't get involved at all unless I import PyQt4.

comment:10 Changed 14 years ago by edsuom

This comment duplicated in ticket:2130

It's not entirely certain in my mind that a Twisted, MIT-licensed reactor will play nice, license-wise with either a GPL or commercial license to Qt and PyQt. The best solution might be for Riverbank Computing to supply a Twisted reactor module suitable for either GPL or commercial licensing on its own, just like it provides the Python bindings for Qt on that basis.

Meanwhile, however, it might be best to write up a fairly detailed bit of documentation describing how a person can integrate the reactor into Qt's event loop and leave the actual code writing up to the developer. That would be a real pain, of course. Hopefully Trolltech and Riverbank will see that it's in their best interests to allow people to purchase their commercial-licensed libraries in order to develop commercial PyQt applications with Twisted, without jumping through such a difficult hoop.

Disclaimer: Nothing in this comment is to be construed as legal advice. Although I probably think about things legal more often than the average person, being a registered patent agent, I am not a lawyer qualified to practice copyright law or anything else outside the representation of patent applicants before the US patent office, and nobody related to this topic is my client in even that capacity.

comment:11 Changed 14 years ago by blais

Regardless of whether the licenses agree, I really do not see why qt4reactor.py itself is not included in the distribution. AFAIU, qt4reactor itself need not comply with the licenses, but whoever combines the libraries. There should be a big blatant comment about the licenses mismatch if you do use it - perhaps even some disableable warning spat out by default on stderr - but that should be left up to the user.

comment:12 Changed 14 years ago by Jean-Paul Calderone

Resolution: wontfix
Status: newclosed

In the next release of Twisted, a mechanism for third-party reactors will be present. This reactor can be distributed independently of Twisted and still used. It might make sense to add it to the QTReactor page, to which the existing qtreactor has been moved.

Changed 13 years ago by therve

Attachment: qt4reactor.2.py added

Update with recent twisted/qt4

comment:13 Changed 13 years ago by cartman

Cc: cartman added

comment:14 Changed 10 years ago by <automation>

Owner: itamarst deleted
Note: See TracTickets for help on using tickets.