Currently, I am iterating through a vector in order to convert it to a QJsonArray:
QJsonArray toJson(const std::vector<unsigned short>& myVec) {
QJsonArray result;
for(auto i = myVec.begin(); i != myVec.end(); i++) {
result.push_back((*i));
}
return result;
}
However, this causes a small lag spike in my program. Is there an alternative method to receive a QJsonArray with the data from a vector? (It doesn't need to be a deep copy.)