
Originally Posted by
Lesiok
int num;
ui.
label->seText
(QString("%1").
arg(num,
2,
'0'));
int num;
ui.label->seText(QString("%1").arg(num,2,'0'));
To copy to clipboard, switch view to plain text mode
the first
you exmaple works after modification under Qt 4.5.0
ui.label->seText(QString("%1").arg(num, 2, 10, QChar('0'));
To copy to clipboard, switch view to plain text mode
the second it adds zero only for positive values. 
"-20"
"-19"
"-18"
"-17"
"-16"
"-15"
"-14"
"-13"
"-12"
"-11"
"-10"
"-9"
"-8"
"-7"
"-6"
"-5"
"-4"
"-3"
"-2"
"-1"
"00"
"01"
"02"
"03"
"04"
"05"
"06"
"07"
"08"
"09"
"10"
"11"
"12"
"13"
"14"
"15"
"16"
"17"
"18"
"19"
"20"
Bookmarks