Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.7.1, 5.15.12
-
None
Description
QJsonObject,QJsonDocument,The following is an error code demonstration:
QJsonObject jo;
jo["id"]=431536871475019777;
qDebug()<<jo<<jo.value("id").toVariant().toLongLong(); //This will output:QJsonObject({"id":431536871475019800}) 431536871475019776,The value is different
//-------------------------------------------
Looking at the QJsonValue code, I found that it was converted to a double type, so there was a precision problem
QJsonValue::QJsonValue(qint64 n) : d(0), t(Double)
{
this->dbl = double;
}