[editor/util] 添加了JsonUtil
parent
3ceeba61b5
commit
e72ba7ebbd
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue