What part you couldn't do?
If you have the QString, you can do the following:
//the list1 will be a list that contains three strings "11", "22" and "33"
QString str = "11.22.33";
QStringList list1 = str.split(".");
//the list1 will be a list that contains three strings "11", "22" and "33"
To copy to clipboard, switch view to plain text mode
Then you need to iterate over the QStringList and use toInt() on the strings that it contains:
//maybe you will need some data structure (for example a QVector) that will contain the integers
QVector<int> vec;
for (iterator = list1.begin(); iterator != list1.end(); ++iterator)
//add the int to the QVector
vec.push_back(iterator->toInt());
//Then you have all the values in the QVector vec
//maybe you will need some data structure (for example a QVector) that will contain the integers
QVector<int> vec;
QStringList::Iterator iterator;
for (iterator = list1.begin(); iterator != list1.end(); ++iterator)
//add the int to the QVector
vec.push_back(iterator->toInt());
//Then you have all the values in the QVector vec
To copy to clipboard, switch view to plain text mode
Bookmarks