diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-11-05 13:20:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-05 21:13:00 +0100 |
commit | 4ffa7d3f651757b7bc10ae9801b7802a8f2e260f (patch) | |
tree | 973b50f41d00719c179b9a332feca11dc0c0f32c /src/qml/qml/qqmlproperty.cpp | |
parent | b63e2e270f79d76d5624e73eb6d05b1bbb55968f (diff) |
Fix rounding behavior of Qml when assigning doubles to integer properties
The engine used to round, but that is inconsistent with ECMAScript's way of
converting doubles to integers by truncation.
With this patch we can also enable the propagation of integer type information
into the IR, but we have to be careful not to utilize it when writing
properties.
Change-Id: I04af4879ba5131349eca2eeff2b27f4598f5267b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index 7723404831..3975b88bb0 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1485,7 +1485,7 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, if (result->isInteger()) QUICK_STORE(int, result->integerValue()) else if (result->isNumber()) - QUICK_STORE(int, qRound(result->doubleValue())) + QUICK_STORE(int, result->doubleValue()) break; case QMetaType::Double: if (result->isNumber()) |