aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/realTypePrecision.qml
Commit message (Collapse)AuthorAgeFilesLines
* Make sure QML type "real" always maps to C++ type "double"Kent Hansen2012-03-071-0/+22
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>