When I parse json, is there any way to distinct this situations:
my_value = "123"
and
my_value = 123
?
Yes, you can get the type of JSON values. In order to get it, you need to call QJsonValue::type() function. In your case it will return either QJsonValue::String or QJsonValue::Double respectively.
QJsonValue::type()
QJsonValue::String
QJsonValue::Double
Copyright © 2021 Jogjafile Inc.
Yes, you can get the type of JSON values. In order to get it, you need to call
QJsonValue::type()
function. In your case it will return eitherQJsonValue::String
orQJsonValue::Double
respectively.