hi,
I want to convert QString into int . Can anybody tell me how to convert it.
Thanks,
Monali
hi,
I want to convert QString into int . Can anybody tell me how to convert it.
Thanks,
Monali
You can use qHash, for example
http://doc.qt.nokia.com/4.6/qhash.html#qHash-7
You are talking about this one: http://wiki.forum.nokia.com/index.ph...ned_data_in_Qt
Also see the reference of this article : Qstring
Best regards.![]()
Use QString::toInt()
What do you want to do, convert decimal characters into an int, or come up with some sort of integer representation for the (non-decimal) string value?
For the former just do:
Use toInt(16) if the string is hex rather than decimal.Code:QString mystring(1234); int myint = mystring.toInt();
Bookmark the Qt reference: http://doc.qt.nokia.com/4.6-snapshot/index.html
At the top of the main page is "All Classes". Click on that and select "QString" from the list. All your answers are there.