How about:
Qt Code:
  1. qint64 GB = 1024*1024*1024;
  2. QString str = QString::number(((double)file.size())/((double)(GB)));
To copy to clipboard, switch view to plain text mode