Hi everyone!
Can any body tell me How to Convert a QStringList into an array of doubles???
e.g. I have a QStringList: 1 2 3 4 5 6 7 8 1 9
The Code that I've tried is as under:
QString str = "1 2 3 4 5 6 7 8 1 9";
QList<QString> list;
list = str.split(QRegExp("\\s+"),QString::SkipEmptyParts);
double n[list.size()];
QList<QString>::iterator i;
int j; QString temp;
for(i = list.begin(); i != list.end(); ++i)
{
temp = *i;
j = list.indexOf(temp);
n[j] = temp.toDouble();
}
for(int j=0;j<list.size();j++)
qDebug()<<n[j];
But the out put is as follows:
1
2
3
4
5
6
7
8
6.952217e-308
9
I've tried java style iterator (while(i.hasNext)............) as well but same result..



