diff options
-rw-r--r-- | lib/converters.h | 4 | ||||
-rw-r--r-- | lib/settings.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/converters.h b/lib/converters.h index e07b6ee4..af6c0192 100644 --- a/lib/converters.h +++ b/lib/converters.h @@ -221,14 +221,16 @@ template <typename T> struct JsonConverter<std::vector<T>> : public JsonArrayConverter<std::vector<T>> {}; +#if QT_VERSION_MAJOR < 6 // QVector is an alias of QList in Qt6 but not in Qt 5 template <typename T> struct JsonConverter<QVector<T>> : public JsonArrayConverter<QVector<T>> {}; +#endif template <typename T> struct JsonConverter<QList<T>> : public JsonArrayConverter<QList<T>> {}; template <> -struct JsonConverter<QStringList> : public JsonConverter<QList<QString>> { +struct JsonConverter<QStringList> : public JsonArrayConverter<QStringList> { static auto dump(const QStringList& sl) { return QJsonArray::fromStringList(sl); diff --git a/lib/settings.cpp b/lib/settings.cpp index 703f4320..1d36db27 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -21,7 +21,9 @@ void Settings::setLegacyNames(const QString& organizationName, Settings::Settings(QObject* parent) : QSettings(parent) { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) setIniCodec("UTF-8"); +#endif } void Settings::setValue(const QString& key, const QVariant& value) |