[PyKDE] Re: QObject code breakage

Phil Thompson phil at river-bank.demon.co.uk
Thu Apr 18 11:54:14 BST 2002


ian reinhart geiser wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Okay I narrowed this down finally.  It looks like the sipConvertToSubClassCode
> that is there crushes any objects created from a C++ based factory.  Since it
> only knows about PyQt objects any derived ones fail.
> 
> The issue is that when you pass a pointer from C++ to an embedded Python
> object it is cast to a QObject if the object has the misfortune of being
> derived from a QObject.  The only other fix is to use MI to confuse SIP
> enough to leave it alone.  It looks like with that code in place all objects
> created by a factory class get clobbered.  I think we should revert the fix,
> because the old way at least worked.  I commented out the
> sipConvertToSubClassCode sections and now it behaves like it should.
> 
> Phil what are the chances this could get into 3.2 yet?

Hang on. The old way was changed for you because it didn't do what you
wanted. The new way requires you to define %ConvertToSubClassCode for
your new classes in your module. Your code will be called before the
corresponding QObject code so that it can recognise your classes.

As PyQt doesn't use this feature itself, it will not be fully tested -
that's up to you. Bland statements that something doesn't work and
therefore should be reverted are not helpful. A proper bug report would
be.

Phil





More information about the PyQt mailing list