play around with the QString json deserializer

This commit is contained in:
Rasmus Karlsson
2018-06-06 11:42:01 +02:00
parent 7f589803be
commit 5724c7ef67
2 changed files with 16 additions and 1 deletions
+12 -1
View File
@@ -24,7 +24,18 @@ struct Deserialize<QString> {
throw std::runtime_error("Deserialized rapidjson::Value is not a string");
}
return value.GetString();
try {
const char *str = value.GetString();
auto strLen = value.GetStringLength();
return QString::fromUtf8(str, strLen);
} catch (const std::exception &e) {
int x = 5;
} catch (...) {
int y = 5;
}
return QString();
}
};