copying a std::vector to a qvector

后端 未结 4 1215
囚心锁ツ
囚心锁ツ 2021-02-20 04:40

I tried copy content of one vector to a QVector using the following

std::copy(source.begin(), source.end(), dest.begin());

However

4条回答
  •  迷失自我
    2021-02-20 05:19

    If you are creating a new QVector with the contents of a std::vector you can use the following code as an example:

       std::vector stdVec;
       QVector qVec = QVector::fromStdVector(stdVec);
    

提交回复
热议问题