TreeFrogFramework  2.8
tjsonutil.h
Go to the documentation of this file.
1 #pragma once
2 #include <QJsonArray>
3 #include <QJsonObject>
4 #include <QList>
5 #include <QVariantMap>
6 
7 
8 template <class T>
9 inline QJsonArray tfModelListToJsonArray(const QList<T> &models)
10 {
11  QJsonArray array;
12 
13  for (auto &mdl : models) {
14  array.append(QJsonValue(QJsonObject::fromVariantMap(mdl.toVariantMap())));
15  }
16  return array;
17 }
18 
QJsonArray tfModelListToJsonArray(const QList< T > &models)
Definition: tjsonutil.h:9