qt - Convert 2D vector to 2D QVector C++ -


i'm working on project in c++ , i'm using visual studio 2010 express along qt creator 5.3.2. gui of application.

my problem want convert 2d vector 2d qvector , don't know how this. have used, example, fromstdvector() conversion of 1d vector 1d qvector, cannot transfer data 2d vector 2d qvector (with function). if help, appreciate it.

source code:

qvector< qvector<double> > test2d; // 2d qvector vector < vector<double> >  std_test2d; // 2d vector  test2d.resize(20); // dimensions of 2d qvector for(int i=0; i<20; ++i) {   test2d[i].resize(44); }  std_test2d.resize(20); // dimensions of 2d vector for(int i=0; i<20; ++i) {   std_test2d[i].resize(44); }  for(int i=0; i<20; i++)  // convert vector qvector??? {     test2d[i].fromstdvector(std_test2d[i]); } 

you're not assigning value. think should work using example code documentation:

 test2d[i] = qvector<double>::fromstdvector(std_test2d[i]); 

Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -