forked from MrBesen/lolautoaccept
get QStrings
This commit is contained in:
parent
d918a936f4
commit
1cc36ae0ee
|
@ -21,6 +21,9 @@ std::string convert(const QJsonValue& val);
|
|||
template<>
|
||||
bool convert(const QJsonValue& val);
|
||||
|
||||
template<>
|
||||
QString convert(const QJsonValue& val);
|
||||
|
||||
template<typename T>
|
||||
T getValue(const QJsonObject& obj, const char* key, const T& def = {}) {
|
||||
auto it = obj.constFind(key);
|
||||
|
|
|
@ -19,6 +19,11 @@ std::string convert(const QJsonValue& val) {
|
|||
return val.toString().toStdString();
|
||||
}
|
||||
|
||||
template<>
|
||||
QString convert(const QJsonValue& val) {
|
||||
return val.toString();
|
||||
}
|
||||
|
||||
template<>
|
||||
bool convert(const QJsonValue& val) {
|
||||
if(val.isString())
|
||||
|
|
Loading…
Reference in New Issue