Hi,

I want to convert some integer to hex-string and pad it with 0.

So far I would do, e.g.

Qt Code:
  1. QString().sprintf("%.8X ", quint32(111));
To copy to clipboard, switch view to plain text mode 

Now I am thinking about dropping use of format strings in new code, and Qt tells me to avoid Qstring::sprintf too and use arg() instead. So I could do

Qt Code:
  1. QString("%1").arg(111, 8, 16, '0')
To copy to clipboard, switch view to plain text mode 


Question: Is there any way to use arg() to avoid having to parse the "%1" format string and just get the string value of arg() call?

Is there any other Qt-way to achieve this with more performance?

Thanks.