As mentioned in other answers, you should use the following method to convert QVector to std::vector :
std::vector<T> QVector::toStdVector() const
And the following static method to convert std::vector to QVector :
QVector<T> QVector::fromStdVector(const std::vector<T> & vector)
Here is an example of how to use QVector::fromStdVector (taken from here ):
std::vector<double> stdvector; vector.push_back(1.2); vector.push_back(0.5); vector.push_back(3.14); QVector<double> vector = QVector<double>::fromStdVector(stdvector);
Remember to specify the type after the second QVector (this should be QVector<double>::fromStdVector(stdvector) , not QVector::fromStdVector(stdvector) ). This will not result in an annoying compiler error.
source share