PDA

View Full Version : how to access ith element of an qstring list?



aurora
18th October 2011, 10:11
hi,
I'm trying to use the following code to iterate the QString List but i'm getting error.
here list is of type QStringList


for (int i = 0; i < list.size(); ++i)
QString element=list.at(i).toLocal8Bit().constData() << endl;

Spitfire
18th October 2011, 10:25
What error?

I'm guessing that "<< endl" is causing you trouble.

Zlatomir
18th October 2011, 10:37
Also if you put the QString at position i into another QString you don't need these conversions list.at(i).toLocal8Bit().constData() just write QString element = list.at(i);