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

David Mugnai dvd at develer.com
Wed Feb 10 09:50:58 GMT 2010


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.


TIA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100210/fbc272a4/attachment.pgp>


More information about the PyQt mailing list