I stumbled upon this line of code in a project I am working on:
QString("%1").arg(2176782335, 6, 36, QChar('0')).toLatin1()
Why are there even multiple arguments for just %1
? Shouldn't this only accept the first parameter in arg()
?
It looks like this overload of QString::arg
. Arguments are:
If you want multiple placeholders in your string, just call arg
multiple times, like shown in the docs.
Also read about number formats .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.