From 951c112fcc543e410c9d1b769d2adcb91ac6eb93 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 26 Jun 2020 13:27:35 +0200 Subject: [PATCH] QmlDesigner: Simply use qFuzzyCompare I think this was done to avoid "ugly" floats, but any rounding should be done in the rewriter. Task-number: QDS-2190 Change-Id: Ibc5fc2609b5ac332191b68fe17d76d9afca21f40 Reviewed-by: Miikka Heikkinen --- .../components/propertyeditor/propertyeditorvalue.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 84e8b527910..b2f44710ade 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -62,10 +62,7 @@ QVariant PropertyEditorValue::value() const static bool cleverDoubleCompare(const QVariant &value1, const QVariant &value2) { //we ignore slight changes on doubles if ((value1.type() == QVariant::Double) && (value2.type() == QVariant::Double)) { - int a = value1.toDouble() * 100; - int b = value2.toDouble() * 100; - - if (qFuzzyCompare((qreal(a) / 100), (qreal(b) / 100))) + if (qFuzzyCompare(value1.toDouble(), value2.toDouble())) return true; } return false;