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.
convert string to int and int to string
hi im beginning with Qt so im developing a simple program who recibes two dates from two lines edits and shows some answer on a Text edit, but when i tring to + this values appears me this mistake:
invalid conversion from int to QTextEdit.
can anybody tellme how can i do this convertion?? and a good link where explain qt? for me its very confuse the documentation who has Qt.
Thanks!!
For a list of conversiion functions you must look at corresponding class references, for example, if you want to see conversion between integer to string please look at the
http://doc.qt.nokia.com/4.6/qstring.html, you can find the built-in functions which will help you in static public members part.
Don´t let your fears stand in the way of your dreams!
int i;
QString k("%1);
k.arg(i);
The following will convert QString to int
QString num="123";
int n = num.toInt();
This will convert Int to QString
int num = 123;
QString str= QString::number(num);
Hope this will be very useful to you...