Dear visitor, welcome to QtForum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
How to convert int toa string then display it?
Im new with QT and im useing qdevelop to make a simple calculator. I need to convert an int into a string so i can display it somehow on the calculator window. How can i do this and which tool should i use to display it (textbrowser?) Thanks for you help this will help me alot!
QString myIntInString = QString::number(yourint);
where to display you have to ask youself what you may display. if a calculator is what you want I guess a lineedit will be fine!
Linux-the best text-adventure ever!
there are a lot of ways. QString class itself have the functions else Refer QLocale class
#include <QLocale>
QLocale con;
int num = 1000;
QString qStr = con.toString(num);
label->setText(qStr);
an Eye 4 Qt