Hello all,
I am running ina trouble, I need to work with int64 but I did not found a solution except to use they like strings.
In the following program the statement 'Doc.object()["ID"].toDouble();' return very close value but not exact, in my environment.
There is some way to extract the entire number without use the string form ("IDs":"635913899220803700") ?
Code:
#include <QtCore/QCoreApplication> #include <QJsonDocument> #include <QJsonParseError> #include <QJsonObject> int main(int argc, char *argv[]){ QJsonParseError err; QJsonDocument Doc=QJsonDocument::fromJson(message.toUtf8(),&err); unsigned long long ia=Doc.object()["ID"].toDouble(); unsigned long long ib=_atoi64(Doc.object()["IDs"].toString().toUtf8().data()); _ASSERT(ia==ib); return a.exec(); }
Cheers,
Giorgio