You are not logged in.

Dear visitor, welcome to 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.



  • "felipe12357" is male
  • "felipe12357" started this thread

Posts: 8

Location: colombia

Occupation: programmer

  • Send private message


Thursday, August 5th 2010, 4:17pm

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.




  • "yasin_motcu" is male

Posts: 32

Location: Türkiye

Occupation: Computer Engineer

  • Send private message


Thursday, August 5th 2010, 7:00pm

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, 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!


Thursday, August 5th 2010, 9:57pm

int i;
QString k("%1);


Friday, August 6th 2010, 11:00am

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...