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;
|
||||
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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user