aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2018-06-26 12:13:45 +0200
committerPaul Wicking <paul.wicking@qt.io>2018-07-10 13:43:25 +0000
commitd3837d4df7dee96db2d9e30270f52def7d49f585 (patch)
tree8e771d94cff3650c2872a3e6301c93a14018f75d /src
parentbc0a1df9c18b0186a64c0c0b50670cc0d3542809 (diff)
Doc: Update QTime to JavaScript Date conversion description
* Update description as the behavior changed with 2b8b7a162be52f8cd6c2bc39f498a1ddfb59dd68. * Remove implementation details from description (the specific date), as it may be subject to change. * Simplify a needlessly complicated explanation. Task-number: QTBUG-68516 Change-Id: Ibc25a9923d8c996c47927964cd69b5bd7bbe0240 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/doc/src/cppintegration/data.qdoc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc
index 9b2771c18e..8a606d672a 100644
--- a/src/qml/doc/src/cppintegration/data.qdoc
+++ b/src/qml/doc/src/cppintegration/data.qdoc
@@ -247,18 +247,18 @@ Similarly, if a C++ type uses a QDateTime for a property type or method
parameter, the value can be created as a JavaScript \c Date object in QML, and
is automatically converted to a QDateTime value when it is passed to C++.
-
-\section2 QTime to JavaScript Date
+//! Target adds an anchor, so renaming the section won't break incoming links.
+\target QTime to JavaScript Date
+\section2 QTime and JavaScript Date
The QML engine provides automatic type conversion from QTime values to
-JavaScript \c Date objects. The date component of the resulting Date
-object should not be relied upon, as it is operating system dependent.
-Specifically, the year (and month and day) are set to zero. Conversion
-from a JavaScript \c Date object to QTime is done by converting to a
-QDateTime, and then relying on QVariant to convert it to a QTime. The end
-effect is that the date part of the \c Date object is ignored, but the
-local timezone will be used ignoring any DST complications it may have.
+JavaScript \c Date objects. As QTime values do not contain a date component,
+one is created for the conversion only. Thus, you should not rely on the date
+component of the resulting Date object.
+Under the hood, conversion from a JavaScript \c Date object to QTime is done by
+converting to a QDateTime object and calling its \l {QDateTime::}{time()}
+method.
\section2 Sequence Type to JavaScript Array