PDA

View Full Version : Desperate QString problem



onegun
30th January 2011, 16:36
I have been spending hours on solving the problem, searched doc and google, but cant find a valid solution


int a=0;
while (a<2)
{
//infos.stops is point to one array, called abc[10]

output = output + QString::fromStdString(*infos.stops)+ "." ;

infos.stops++;
a++;
}
ui->showMsg->setText(output);
the problem is infos.stops did show, but some funny characters appear like link removed.

i have uploaded all my source code which is designed in QT Designer link removed the problem line is at manager.cpp line 133
[1]:

ChrisW67
30th January 2011, 21:47
Please use [code] tags around code in these forums.
Please upload any images/files to this forum rather than linking to external sites. Linking to external sites is likely to leave this post without any supporting image/file if the other site goes away or stops service because QtCentre is leaching off their bandwidth (this is probably why the links were removed).

Without the linked information you don't provide enough information about the type of info.stops or abc[10] for us to make sense of what you are trying to do.

My guess is that info.stops either does not point to a C string at all, or only does so until you increment the pointer after the first run through the loop.

zgulser
31st January 2011, 09:52
Hi,

I think the problem is in appending. You may use append(..) function instead '+' operator.