Copying Container Areas : QVector « Qt « C++






Copying Container Areas

  


#include <QStringList>
#include <QVector>
#include <QDebug>

int main()
{
  QStringList list;
  list << "one" << "two" << "three";

  QVector<QString> vect(list.size());
  qCopy(list.begin(), list.end(), vect.begin());
  qDebug() << vect; // output: ( "one", "two", "three" )
  return 0;
}

   
    
  








Related examples in the same category

1.Using QVector
2.Store QPoint in QVector
3.creates two containers and compares all the elements for equality: