Alternate calendar in plasma - feature request discussion

Gary Wang wzc782970009 at gmail.com
Wed Dec 9 06:12:24 GMT 2020


> Is the calendaring system needed for China supported in Qt?

No, right now it only support "Julian", "Islamic Civil", "Jalali",
"Milankovic", "Persian", "Islamic", "islamic-civil", "islamicc",
"gregory", "Gregorian". Adding a custom calendar system requires
subclass QCalendarBackend which is a private Qt API.

I also think there are some issue in the QCalendar API design. For
example, it only provide a way to check if the year is a leap year,
but not possible to know if a month is leap month. Also we cannot get
the display name of a day (the 1st day of a month names "初一",
I haven't found the API which can get the localized day name for this
need).

While I doing resources about calendar systems, I found the icu4c's
implementation is much better, but I don't know much about different
calendar systems so I'm not sure about if it's I didn't fully
understand the QCalendar API or is QCalendar API actually missing
something which need to be added.

Please also take a look at https://docs.google.com/document/d/1iwEwwK9w34ZKOegb8xcecO4u2Pjgv2e7ifXMFKox62Q/edit?usp=sharing
and https://bugs.kde.org/show_bug.cgi?id=429892 which also have some
other additional information which might useful on this topic :)

> This class is new as of Qt 5.14, so we couldn't depend on it yet.

Yeah, and also, the QCalendar class doesn't come with chinese lunar
calendar system support, so if subclassing QCalendarBackend (private API)
is not acceptable, then we may need wait longer to make such feature land
into KDE. So I suggest we can create a plugin API to add alternate
calendar support, and plugin writer can use whatever libs they want for
their alternate calendar implementation. If we do that, this feature
itself will also not rely on a specific Qt version.

> If the Chinese calendar support needs to be added in Qt, I suggest to
> contact developers at the Qt development mailing list.

Will try to send a mail later. I'm still pretty new to mailing list and
not sure about how to use it properly XD

Gary



More information about the Plasma-devel mailing list