diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-11-08 18:53:37 +0100 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-11-08 18:53:37 +0100 |
commit | 7355e2f801eb85e771a6c454c77f9eb62398f38b (patch) | |
tree | 788d127f093c5b9222cc3c40a5f15abf114dc328 | |
parent | 21fd088d207ee2c2724c5b250875a843b618497d (diff) | |
download | libquotient-7355e2f801eb85e771a6c454c77f9eb62398f38b.tar.gz libquotient-7355e2f801eb85e771a6c454c77f9eb62398f38b.zip |
converters.h: add QUrl support
-rw-r--r-- | lib/converters.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/converters.h b/lib/converters.h index 543e9496..81d7b6d8 100644 --- a/lib/converters.h +++ b/lib/converters.h @@ -166,6 +166,14 @@ struct JsonConverter<QDate> { }; template <> +struct JsonConverter<QUrl> : JsonConverter<QString> { + static auto dump(const QUrl& url) // Override on top of that for QString + { + return JsonConverter<QString>::dump(url.toString(QUrl::FullyEncoded)); + } +}; + +template <> struct JsonConverter<QJsonArray> : public TrivialJsonDumper<QJsonArray> { static auto load(const QJsonValue& jv) { return jv.toArray(); } }; |