Commit 274e3878 authored by Volker Krause's avatar Volker Krause
Browse files

Fix number to string deserialization for large integer numbers

parent e30ca412
Pipeline #72773 passed with stage
in 9 minutes and 55 seconds
...@@ -85,6 +85,11 @@ static QVariant propertyValue(const QMetaProperty &prop, const QJsonValue &v) ...@@ -85,6 +85,11 @@ static QVariant propertyValue(const QMetaProperty &prop, const QJsonValue &v)
switch (prop.type()) { switch (prop.type()) {
case QVariant::String: case QVariant::String:
if (v.isDouble()) { if (v.isDouble()) {
double i = 0.0;
const auto frac = std::modf(v.toDouble(), &i);
if (frac == 0.0) {
return QString::number(static_cast<uint64_t>(i));
}
return QString::number(v.toDouble()); return QString::number(v.toDouble());
} }
return v.toString(); return v.toString();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment