Use compact style of JSON data

This commit is contained in:
buinsky 2015-01-29 17:04:11 +03:00
parent bed0784a2d
commit ba86d16e78

View file

@ -45,9 +45,11 @@ namespace json {
inline QByteArray toJson(const QVariant& var)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
return QJsonDocument::fromVariant(var).toJson();
return QJsonDocument::fromVariant(var).toJson(QJsonDocument::Compact);
#else
return QJson::Serializer().serialize(var);
QJson::Serializer serializer;
serializer.setIndentMode(QJson::IndentCompact);
return serializer.serialize(var);
#endif
}