[Qt-interest] S60v5 Jalali calendar
John Layt
johnlayt at googlemail.com
Wed Aug 17 20:03:35 CEST 2011
On Monday 15 Aug 2011 09:05:12 ahmed shaker wrote:
> Hi
>
> Is it good ide that I use subclass of QDate for Jalali (persian) Calendar
> and convert date?
>
> Tnx
No, QDate does not have the required virtual methods to make sub-classing it
easy, you would have to reimplement everything.
In KDE we had the same problem, we created a new class KCalendarSystem with
derived classes for all our date conversions. It uses QDate as a container to
pass around the Julian Day value, then KCalendarSystem translates that into
the required calendar system.
http://api.kde.org/4.x-api/kdelibs-
apidocs/kdecore/html/classKCalendarSystem.html
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/kdecore/date/kcalendarsystemjalali.cpp
Please note that the code is LGPL licensed, but I hold most of the copyright
so can let you use parts if required.
Proper support is planned for Qt5, I'm coding it now, but that won't help you
on S60 :-)
Cheers!
John.
More information about the Qt-interest-old
mailing list