diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-03-05 11:54:01 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-07 12:10:27 +0100 |
commit | aed15e776277410fb43ce2d2a9a8924359a58653 (patch) | |
tree | 426dfd76e6db21616beaea518b13224844ac9e51 /doc/src | |
parent | 3f3850e954aac35b916c01546c69783183824b35 (diff) |
Make sure QML type "real" always maps to C++ type "double"
The type "real" was documented to be a single-precision float, but
that's incorrect. It's always been double.
However, signal parameters of type "real" would be mapped to the C++
type "qreal", which can be either float or double depending on the
platform.
Since JavaScript floating point numbers have double precision, QML
should use the same, to avoid potential loss of precision.
With this change, "real" behaves the same as the QML "double" type
(which already guaranteed double precision). Even though it's
redundant, "double" is kept to preserve compatibility.
Added tests for the "double" type to the QML meta-object autotest,
and a test for the "real" type that ensures there's no loss of
precision.
Change-Id: I1a77f1fd45082ff670684a935e17d1a46ea75d84
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/qml/basictypes.qdoc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/src/qml/basictypes.qdoc b/doc/src/qml/basictypes.qdoc index 0f66a96731..317dd54443 100644 --- a/doc/src/qml/basictypes.qdoc +++ b/doc/src/qml/basictypes.qdoc @@ -88,7 +88,7 @@ Item { width: 100.45; height: 150.82 } \endqml - \bold{Note:} In QML all reals are stored in single precision, \l + \bold{Note:} In QML all reals are stored in double precision, \l {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point} format. |