QmlDesigner.MetaInfo: interpret numberValue as real

Number value is used for integer and real types.
(e.g. QRect and QRectF).

To avoid rounding real to int for QRectF/QSizeF we interpret
numberValue as real.

Change-Id: I051f960d7ef8a391d0a27641516d233175c6d3b1
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
Thomas Hartmann
2014-03-05 16:13:33 +01:00
parent 5b8412f33e
commit 5ca2d3ac9a

View File

@@ -147,10 +147,11 @@ public:
TypeId typeId;
TypeName typeName = typeId(value).toUtf8();
if (typeName == "number") {
if (value->asRealValue())
typeName = "real";
else
if (value->asIntValue()) {
typeName = "int";
} else {
typeName = "real";
}
}
m_properties.append(qMakePair(propertyName, typeName));
}