QVector<QVector<QString> > vectorOfVectorsOfStrings;
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
{
QVector<QString> foo; //create a QVector of QStrings
foo.push_back("fooo");
foo.push_back("booo");
vectorOfVectorsOfStrings.push_back(foo); //add the created vector as a line in your 2D vector
}
for(int i = 0; i < vectorOfVectorsOfStrings.size(); i++)
{
for(int j = 0; j < vectorOfVectorsOfStrings[i].size(); j++)
{
//do stuff with the QString vectorOfVectorsOfStrings[i][j]
}
}
QVector<QVector<QString> > vectorOfVectorsOfStrings;
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
{
QVector<QString> foo; //create a QVector of QStrings
foo.push_back("fooo");
foo.push_back("booo");
vectorOfVectorsOfStrings.push_back(foo); //add the created vector as a line in your 2D vector
}
for(int i = 0; i < vectorOfVectorsOfStrings.size(); i++)
{
for(int j = 0; j < vectorOfVectorsOfStrings[i].size(); j++)
{
//do stuff with the QString vectorOfVectorsOfStrings[i][j]
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks