QList::fromStdList
allows you to create QList
from std::list
. But how to create QList
from std::vector
?
Of course, aside from manual looping:
QList<T> myList;
myList.reserve(vector.size());
for(size_t i = 0, l = vector.size(); i < l; ++i)
myList << vector[i];