PDA

View Full Version : How to convert Int to QString in QT4?



drake1983
11th March 2007, 07:49
Sorry, but I am completely a noob using QT, I need to know how to convert an int to QString, using vcl from Borland was intToStr(value), but in QT4 how can I do it?

I QTAsistant I read something about using QVariant, but I need help.

thanks...

drake1983
11th March 2007, 07:58
Hey guys, I find a way, but I don't know if it's the best, anyway I did the following:



QVariant tempAge( listSE->getNode(i)->getData().getAge());
QString age( tempAge.toString() );



Is there another way to do this?
thanks!!!

Brandybuck
11th March 2007, 07:58
Lots of ways. The easiest in my opinion is the static method:

QString::number(int);