Fix generic conversion of list-like values to JSON arrays
Previously, QVariant::toList() was used to convert a QVariant to a
QVariantList. This only works for actual QVariantLists and QStringList,
however. This patch uses QVariant::value<QVariantList>() which works in all
cases.
A better approach would be to extract a QSequentialIterable, but QTBUG-42016
currently prevents this.
Change-Id: I732cc88a6db2ec5d990760364a9db98a52521f6b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| commit | 1466130070922a6cc55c2a5b724311780a394a13 |
| parent | fc891dad209725113f49f42cfd59a5ced6ff89d2 |
| author | Arno Rehn <a.rehn@menlosystems.com> |
| committer | Milian Wolff <milian.wolff@kdab.com> |
| commit time | Wed, 15 May 2019 20:04:28 +0000 |