I have a form having a list widget and a label. I want to display file permission, when I click listwidget having file names got from some filesystem. I used following code :

Qt Code:
  1. QFile file(strpath);
  2. QFileDevice::Permissions p = file.permissions();
  3. labelpermission->setText(QString::number(p));
To copy to clipboard, switch view to plain text mode 
in help manual I got following :-
Qt Code:
  1. QFileDevice::ReadOwner 0x4000 The file is readable by the owner of the file.
  2. QFileDevice::WriteOwner 0x2000 The file is writable by the owner of the file.
  3. QFileDevice::ExeOwner 0x1000 The file is executable by the owner of the file.
  4. QFileDevice::ReadUser 0x0400 The file is readable by the user.
  5. QFileDevice::WriteUser 0x0200 The file is writable by the user.
  6. QFileDevice::ExeUser 0x0100 The file is executable by the user.
  7. QFileDevice::ReadGroup 0x0040 The file is readable by the group.
  8. QFileDevice::WriteGroup 0x0020 The file is writable by the group.
  9. QFileDevice::ExeGroup 0x0010 The file is executable by the group.
  10. QFileDevice::ReadOther 0x0004 The file is readable by anyone.
  11. QFileDevice::WriteOther 0x0002 The file is writable by anyone.
  12. QFileDevice::ExeOther 0x0001 The file is executable by anyone.
To copy to clipboard, switch view to plain text mode 
and when I was in exicuting program prmission was displayed as : 21845 ( for /bin/GET ) or 30581 (for /home/rahul/.netbeans).
Now I want to display this numeric code in form of "drwxr-xr-x" format. But here is only four fields and in numeric code there are five fields.
So my question is how to decode this numeric code to rwx code and display in QLabel.