forked from qt-creator/qt-creator
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:
@@ -147,10 +147,11 @@ public:
|
|||||||
TypeId typeId;
|
TypeId typeId;
|
||||||
TypeName typeName = typeId(value).toUtf8();
|
TypeName typeName = typeId(value).toUtf8();
|
||||||
if (typeName == "number") {
|
if (typeName == "number") {
|
||||||
if (value->asRealValue())
|
if (value->asIntValue()) {
|
||||||
typeName = "real";
|
|
||||||
else
|
|
||||||
typeName = "int";
|
typeName = "int";
|
||||||
|
} else {
|
||||||
|
typeName = "real";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_properties.append(qMakePair(propertyName, typeName));
|
m_properties.append(qMakePair(propertyName, typeName));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user