[PyQt] QDateEdit is ignoring the sip API level 2

Linos info at linos.es
Tue Jun 7 12:14:57 BST 2011


El 07/06/11 13:07, Phil Thompson escribió:
> On Tue, 7 Jun 2011 11:46:08 +0100, Daniele Esposti<expo at expobrain.net>
> wrote:
>> Well, datetime package doesn't support operations with QDate
>> instances, for example QDateEdit().date() + datetime.timedelta(days=1)
>> raises a TypeError.
>
> Just use...
>
> QDateEdit().date().toPyDate() + datetime.timedelta()
>
>> IMHO it's more clear to return a datetime instance instead a Qt one,
>> like the QLineEdit.tex() method returns a unicode string instead of a
>> QString if the sip API level for QString is set to 2. Again, IMHO.
>
> I felt that QDate and QTime were too useful to remove.
>
> Phil

I felt the same way that Phil, they are useful clases on their own, i much 
prefer working with them that with datetime.

Regards,
Miguel Angel.



More information about the PyQt mailing list