Do u want spaces to span the 5-x length ? or a single space if the length is less than 5 ??
If its latter, you can do it as -
if(myString.lengt()<5)
myString.append(" ");
if(myString.lengt()<5)
myString.append(" ");
To copy to clipboard, switch view to plain text mode
if u want the former way then -
myString.
append( QString("").
fill(MAX
-myString.
length());
myString.append( QString("").fill(MAX-myString.length());
To copy to clipboard, switch view to plain text mode
Hope u get the idea, 
For numbers, u can use prepend with the same logic
Bookmarks