PDA

View Full Version : String to Integer / Integer to String



hesam
26th May 2010, 11:40
Hi,

In my program I have three lineEdit to add two numbers and show the resault.
my problrm is I don't know how can I convert string to integer and after calculation convert Integer to String.

please guide me.

Thanks

high_flyer
26th May 2010, 11:42
Have a look a QString doc.

hesam
26th May 2010, 11:51
Are these ok?

int toInt ( bool * ok = 0, int base = 10 ) const
std::string toStdString () const

high_flyer
26th May 2010, 12:14
Will my answer be faster to read then the function documentation?
I mean really, no disrespect, but what do you expect with such questions?

squidge
26th May 2010, 12:59
Do they work? If so, yes, otherwise, No :)