Does QJsonValue differ strings of digits from integers?

195 Views Asked by At

When I parse json, is there any way to distinct this situations:

my_value = "123"

and

my_value = 123

?

1

There are 1 best solutions below

0
On BEST ANSWER

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.