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

List:       pykde
Subject:    Re: [PyQt] Construct QVariant from object of user type
From:       "Arve Knudsen" <arve.knudsen () gmail ! com>
Date:       2008-04-16 8:31:44
Message-ID: a0d6258d0804160131y746f6cbt5569c444685cd00b () mail ! gmail ! com
[Download RAW message or body]

Phil, any comment on this?

Thanks,
Arve

On Mon, Apr 14, 2008 at 10:32 PM, Arve Knudsen <arve.knudsen@gmail.com> wrote:
> On 4/14/08, alteo_gange <romanocaldoni@free.fr> wrote:
>  > 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
>
>  This works for date just because it maps to QDate.
>
>  Arve
>

_______________________________________________
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