[editor/util] 添加了JsonUtil

dev-LayerStyle
ArgonarioD 2023-03-16 01:53:28 +08:00
parent 3ceeba61b5
commit e72ba7ebbd
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#pragma once
#include <QJsonArray>
namespace JsonUtil
{
#include <vector>
template<typename T>
QJsonArray toQJsonArray(const std::vector<T>& vec)
{
QJsonArray array;
std::copy(vec.begin(), vec.end(), std::back_inserter(array));
return array;
}
}