Hello all,
maybe somebody can help me.
I'm using Qt5.2 and I'm trying to parse QJsonDocument as QString in compact output. But it's not working.
On other systems with eg. Qt5.1 ist working without problems.
Here is my code:
QJsonObject obj;
obj.insert("test",123);
QJsonDocument jd;
jd.setObject(obj);
qDebug() << "jd.toJson()" ;
qDebug() << jd.toJson();
qDebug() << "jd.toJson(QJsonDocument::Compact)";
qDebug() << jd.toJson(QJsonDocument::Compact);
qDebug() << "jd.toJson(QJsonDocument::Indented)";
qDebug() << jd.toJson(QJsonDocument::Indented);
QJsonObject obj;
obj.insert("test",123);
QJsonDocument jd;
jd.setObject(obj);
qDebug() << "jd.toJson()" ;
qDebug() << jd.toJson();
qDebug() << "jd.toJson(QJsonDocument::Compact)";
qDebug() << jd.toJson(QJsonDocument::Compact);
qDebug() << "jd.toJson(QJsonDocument::Indented)";
qDebug() << jd.toJson(QJsonDocument::Indented);
To copy to clipboard, switch view to plain text mode
and the output:
jd.toJson()
"{
"test": 123
}
"
jd.toJson(QJsonDocument::Compact)
/opt/qt_app/bin/qt_app: symbol lookup error: /opt/qt_app/bin/qt_app: undefined symbol: _ZNK13QJsonDocument6toJsonENS_10JsonFormatE
Bookmarks