[Development] Qt Quick Controls Calendar

Martin Klapetek martin.klapetek at gmail.com
Fri Dec 6 15:38:40 CET 2013


On Fri, Dec 6, 2013 at 3:08 PM, Mark Gaiser <markg85 at gmail.com> wrote:

>
> -- Locale --
> In KDE there was already an issue with differences between the
> JavaScript date object and the QDate object. I don't know the fine
> details here, someone else will probably fill that in i hope. I know
> there where issues, just not what exactly.
>

The problem is different values for same things - JS Date object numbers
months from 0 to 11 whereas QDate's months are from 1 to 12. Same goes for
days-in-the-week enum - JS Date starts at 0 = Sunday .. 6 = Saturday, while
QDate has 1 = Monday .. 7 = Sunday. There might be more differences.

So you cannot pass direct values between QML and C++ (like passing
QDate::month() to JS), passing whole date objects should be fine afaik (eg.
passing JS Date to a C++ function expecting QDate).

Cheers
-- 
Martin Klapetek | KDE Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131206/950a3c71/attachment.html>


More information about the Development mailing list