Hey guys,
How do you go about converting a uint or int to a QString?
Thanks in advanced.
Hey guys,
How do you go about converting a uint or int to a QString?
Thanks in advanced.
use one of setNum methods:
http://doc.trolltech.com/4.1/qstring.html#setNum
Bojan
The march of progress:
C:
printf("%10.2f", x);
C++:
cout << setw(10) << setprecision(2) << showpoint << x;
Java:
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
freak (13th June 2006)
Or use QString::number() static method.
freak (13th June 2006)
Bookmarks