[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Signal/slot bug when doing multiple connects and Qt::UniqueConnection
From:       Giuseppe Corbelli <giuseppe.corbelli () copanitalia ! com>
Date:       2014-04-30 8:42:45
Message-ID: 5360B785.9000701 () copanitalia ! com
[Download RAW message or body]

On 29/04/2014 16:05, Phil Thompson wrote:
> On 28/04/2014 10:39 am, Giuseppe Corbelli wrote:
>> On 28/04/2014 09:26, Giuseppe Corbelli wrote:
>>> Hi all
>>> I've run into an "interesting" side effect, admittedly misusing the
>>> signal-slot mechanism. Basically I'm doing multiple connections using the
>>> Qt::UniqueConnection parameter. As expected the slot is run always a single
>>> time, but there's something weird going on in the background. The receivers()
>>> method returns increasing numbers and this little example will kill the CPU in
>>> a few iteractions.
>
> Fixed in tonight's PyQt4 and PyQt5 snapshots - I just hadn't bothered to add
> support for UniqueConnection.

Issue solved. One question, though: I see you're checking for

#if QT_VERSION >= 0x040600
     if (type == Qt::UniqueConnection)

This would break again if I use any other type ORed, say 
BlockingQueuedConnection|UniqueConnection.

Why not:

#if QT_VERSION >= 0x040600
     if ((type & Qt::UniqueConnection) == Qt::UniqueConnection)

?

-- 
             Giuseppe Corbelli
WASP Software Engineer, Copan Italia S.p.A
Phone: +390303666318  Fax: +390302659932
E-mail: giuseppe.corbelli@copanitalia.com
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic