[Development] Calendar Types
John Layt
jlayt at kde.org
Thu Oct 17 23:11:52 CEST 2013
On 17 October 2013 19:30, <qtdev at madagon.com> wrote:
> finally, I'm going to update date time classes to support world calendar
> types while keeping the binary compatibility.
>
> here's an overview of the new changes to be done at this level. Please
> review and let me know if something wrong.
>
> #JohnLayt I'd like to specially hear from you.
Hi,
QCalendarSystem is on my TODO list for Qt5.3, but there's a series of
steps we need to complete first to get there.
I do have working code for most of the calendar systems at [1], but
while the API is close to what we will use, the formulas are unlikely
to get used now. This is because the data required for the names
would add 3-5 MB to the QtCore library size which was deemed too much.
We instead decided to use ICU for all our localization, but that ran
into other problems and so that was shelved too. There's an outline
of the ICU-based api design at [2], but obviously that now needs to be
reviewed.
The design we will now use is for QCalendarSystem (and other locale
code) to be a thin wrapper around each platforms native support, just
like I did for QTimeZone. I'll be starting on updating the design
next week.
The problem is that before starting on QCalendarSystem we need to
change QLocale to only use the native platform locale code and
database instead of Qt's own. The biggest part of that is changing
Linux to always use ICU instead. I have most of the code for that but
it needs more work.
So, once all that is done we can then add QCalendarSystem, after which
we will need to integrate it into QLocale and QDateTime and the
datetime widgets, so a lot of work to do.
The one thing that won't happen is that QDate will start returning
local calendar values, it will only ever return Gregorian dates to
maintain backwards compatible behaviour. To get local calendar values
you access the calendar via QLocale.
So, for now wait a little and I'll have an updated design ready in a
couple of weeks to be discussed on list before we get started.
Cheers!
John.
[1] https://qt.gitorious.org/qt/odysseus-qtbase/commit/9c1b7ec7772ba2ae1da904c4054bd9032836adff
[2] http://qt-project.org/wiki/Qt-5-ICU
More information about the Development
mailing list