diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-17 20:27:10 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-17 20:27:10 +0100 |
commit | bcf7f7e6408872d8315e5c69829d7ce790e4820a (patch) | |
tree | 7aab214c796779dd92ae050e13824c1ec850a85b /lib/converters.h | |
parent | d97195d3c67dcf08d727a2a65863b99982c6b24e (diff) | |
download | libquotient-bcf7f7e6408872d8315e5c69829d7ce790e4820a.tar.gz libquotient-bcf7f7e6408872d8315e5c69829d7ce790e4820a.zip |
Fix QDateTime(QDate) deprecation warnings
Diffstat (limited to 'lib/converters.h')
-rw-r--r-- | lib/converters.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/converters.h b/lib/converters.h index d9a68bfb..8ec0fa81 100644 --- a/lib/converters.h +++ b/lib/converters.h @@ -146,7 +146,15 @@ struct JsonConverter<QDateTime> { template <> struct JsonConverter<QDate> { - static auto dump(const QDate& val) { return toJson(QDateTime(val)); } + static auto dump(const QDate& val) { + return toJson( +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) + QDateTime(val) +#else + val.startOfDay() +#endif + ); + } static auto load(const QJsonValue& jv) { return fromJson<QDateTime>(jv).date(); |