Convert an int to a QString with zero padding (leading zeroes)
QString QString::rightJustified ( int width, QChar fill = QLatin1Char( ' ' ), bool truncate = false ) const
int myNumber = 99;
QString result;
result = QString::number(myNumber).rightJustified(5, '0');
result is now 00099
Use this:
QString number = QStringLiteral("%1").arg(yourNumber, 5, 10, QLatin1Char('0'));
5 here corresponds to 5 in printf("%05d")
. 10 is the radix, you can put 16 to print the number in hex.