bluedream bluedream - 1 year ago 46
C++ Question

Using QString get strange characters in the output

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:

enter image description here

I have uploaded all my source code which is designed in QT Designer
http://uploading.com/files/eaddfaf8/bus.zip/
The problem line is at manager.cpp line 133.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download