I'm not very fit with the QString class. I need to build a string representation of data which is a mixture of text and data. Is there a more elegant way than doing this?
QList<float> angles;
string = "data starts here: ";
for (int i = 0; i <angles->size(); i++)
{
temp.sprintf("\t%.2f", angles.at(i));
string.append(temp);
}
QString string;
QString temp;
QList<float> angles;
string = "data starts here: ";
for (int i = 0; i <angles->size(); i++)
{
temp.sprintf("\t%.2f", angles.at(i));
string.append(temp);
}
To copy to clipboard, switch view to plain text mode
And then what's the best way to print this string to stdout? All I know is printf from C and I can't get that to work with Qstring.
Thanks
Cruz
Bookmarks