From 5e018f19e06949407685ba547d08d7bbef068c78 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sun, 2 Aug 2020 18:50:54 +0200 Subject: qt6: use auto & in the lambda in the jsonhelper.h In qt6, QJsonArrayRef cannot be implicitly converted to QVariant, but we don't need that, we can simply call .toString() on the QJsonArrayRef object. Change-Id: I8cf394133f12946b195211df217e9d42c8d14fa5 Reviewed-by: Christian Kandeler --- src/lib/corelib/tools/jsonhelper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/corelib/tools/jsonhelper.h b/src/lib/corelib/tools/jsonhelper.h index 991d6bd6c..e695bd465 100644 --- a/src/lib/corelib/tools/jsonhelper.h +++ b/src/lib/corelib/tools/jsonhelper.h @@ -62,7 +62,7 @@ template<> inline QStringList fromJson(const QJsonValue &v) const QJsonArray &jsonList = v.toArray(); QStringList stringList; std::transform(jsonList.begin(), jsonList.end(), std::back_inserter(stringList), - [](const QVariant &v) { return v.toString(); }); + [](const auto &v) { return v.toString(); }); return stringList; } template<> inline QVariantMap fromJson(const QJsonValue &v) { return v.toObject().toVariantMap(); } -- cgit v1.2.3