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

List:       pykde
Subject:    Re: [PyQt] Function pointers and SIP
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2009-06-19 7:36:47
Message-ID: 602323596c281e52b8c8d04a6f179ae1 () localhost
[Download RAW message or body]

On Fri, 19 Jun 2009 03:27:02 +0200, Giovanni Bajo <rasky@develer.com>
wrote:
> On gio, 2009-06-18 at 19:01 +0100, Phil Thompson wrote:
>> On Thu, 18 Jun 2009 19:40:08 +0200, Giovanni Bajo <rasky@develer.com>
>> wrote:
>> > Hi Phil,
>> > 
>> > given a C++ object where you can register callbacks such as:
>> > 
>> >      void registerCallback(void (*cb)(void*), void* user_data);
>> > 
>> > or
>> > 
>> >      void registerCallback(std::tr1::function<void (void)> cb);
>> > 
>> > how would you wrap them in SIP? Is there some code in PyQt that I can 
>> > look at?
>> 
>> I think you answered this yourself a couple of weeks back.
> 
> I had a general idea of course, but I wanted to make sure there was not
> automa[tg]ic support by SIP which I wasn't aware of.
> 
>> The nearest example in PyQt is probably qInstallMsgHandler().
> 
> Thanks. Why the internal qtcore_MsgHandler uses
> SIP_BLOCK_THREAD/SIP_UNBLOCK_THREADS? Is that always needed or only if I
> have previously explicitly released the GIL?

It's not needed if you are absolutely sure the GIL has been acquired.

Phil
_______________________________________________
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