[PyQt] Construct QVariant from object of user type

alteo_gange romanocaldoni at free.fr
Mon Apr 14 17:29:21 BST 2008


Le lundi 14 avril 2008, Arve Knudsen a écrit :
> How do I construct a QVariant of an object of a non-Qt class?

Hi.

>>> from PyQt4.QtCore import *
>>> from datetime import date
>>> a=date(1991,12,13)
>>> b=QVariant(a)
>>> print b.toDate().toPyDate()
1991-12-13

-- 
alteo_gange




More information about the PyQt mailing list