[PyQt] [BUG] unboxing a python instance from a QVariant

Phil Thompson phil at riverbankcomputing.com
Wed Feb 10 14:00:07 GMT 2010


On Wed, 10 Feb 2010 10:50:58 +0100, David Mugnai <dvd at develer.com> wrote:
> Hi all,
> 
> I have a, reproducible, weird interaction with a (not so) "special"
> named class and the QVariant. Let me show the code:
> 
>
------------------------------------------------------------------------------
> from PyQt4.Qt import *
> 
> class Effect(QObject):
> pass
> 
> app = QApplication([])
> 
> x = Effect()
> v = QVariant(x)
> 
> print v.toPyObject()
>
------------------------------------------------------------------------------
> 
> the result is:
> <PyQt4.phonon.Effect object at 0x00CD44B0>
> 
> if I rename my class in Effect2 I obtain:
> <__main__.Effect2 object at 0x00CD4468>
> 
> I'm using PyQt 4.7, Python 2.6 on an XP box.

Should be fixed in tonight's snapshot.

Thanks,
Phil


More information about the PyQt mailing list