View Full Version : explanation for Qstring to int
qtlinuxnewbie
11th February 2010, 04:31
hi,
i have searched for QString to int . i got the
str.append(QString("%1").arg(int));.
Can any one Explain me about the above line.:confused::confused:
Thnx in advance.
franz
11th February 2010, 06:52
Obviously there is a lot about this in the QString documentation, including the workings of QString::arg() (http://doc.trolltech.com/4.6/qstring.html#arg).
QString("%1")
Creates a string with %1 as content.
.arg(int) replaces the lowest %N in the string it is called on with a string representation of the int.
The whole new string is then appended to str.
To convert string to int, use str.toInt().
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.