diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2020-08-02 18:50:54 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2020-08-03 15:25:54 +0000 |
commit | 5e018f19e06949407685ba547d08d7bbef068c78 (patch) | |
tree | d6d94681046b0f54a0af8890cd12af39ef679584 | |
parent | 6f520bb8730282d2d93a3a816fec1a7d4f3f127d (diff) |
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 <christian.kandeler@qt.io>
-rw-r--r-- | src/lib/corelib/tools/jsonhelper.h | 2 |
1 files changed, 1 insertions, 1 deletions
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(); } |