Qt Code:
  1. QVector<QVector<QString> > vectorOfVectorsOfStrings;
  2.  
  3. for(int i = 0; i < 3; i++) //of course you might not want to init the vectors in a loop - this is just an example
  4. {
  5. QVector<QString> foo; //create a QVector of QStrings
  6. foo.push_back("fooo");
  7. foo.push_back("booo");
  8. vectorOfVectorsOfStrings.push_back(foo); //add the created vector as a line in your 2D vector
  9. }
  10.  
  11. for(int i = 0; i < vectorOfVectorsOfStrings.size(); i++)
  12. {
  13. for(int j = 0; j < vectorOfVectorsOfStrings[i].size(); j++)
  14. {
  15. //do stuff with the QString vectorOfVectorsOfStrings[i][j]
  16. }
  17. }
To copy to clipboard, switch view to plain text mode