[PyQt] GIL related problem? Code inside.
Phil Thompson
phil at riverbankcomputing.co.uk
Sat Apr 21 14:16:26 BST 2007
On Thursday 19 April 2007 1:37 pm, V. Armando Sole wrote:
> Phil Thompson wrote:
>
> """
> 3. Automatically release the GIL whenever any Qt call is made from a
> QObject derived class. The assumption is that this will cover the vast
> majority of cases. Any other cases would have to be identified through bug
> reports. """
This applied to PyQt4, not PyQt3.
> I guess I have one bug report.
>
> We have got some problems with old PyQt3 applications when upgrading to the
> latest sip and PyQt. The problem comes from the new GIL handling and the
> use of QApplication.postEvent inside QThreads.
>
> While we agree on the above described behaviour, perhaps an exception
> should be made for qt.QApplication.postEvent (at least from inside a
> QThread). The cleanest way we found to solve our problem is to replace
> every appearence of QApplication.postEvent by QThread.postEvent if the call
> is made from inside a qthread. At the qt level both calls are exactly the
> same, but Trolltech says in the documentation that QThread.postEvent is
> obsolete.
>
> The code below reproduces the problem if desired and shows the solution
> too.
It's a regression in 3.17.1 and I've backed out the change in tonight's
snapshot. If you confirm it fixes your problems I'll release 3.17.2 in the
next few days.
Thanks,
Phil
More information about the PyQt
mailing list