[Qt-interest] File Size human-readable ?
Atlant Schmidt
aschmidt at dekaresearch.com
Mon Aug 30 13:51:05 CEST 2010
Omar:
Do you mean a method that will convert an arbitrary
integer to QStrings that contain strings such as:
o "12 Bytes"
o "1.3 kBytes"
o "27.6 Mbytes"
o "78.27 GBytes"
and so forth?
If so, I don't know of a Qt method to do this (others
may, of course) but it's very easy to do this in plain
old C(++) using an if-else_if chain. And in writing it
yourself, you get to decide on the points where you
switch the formatting for the various "sizes", how
much precision to display at each step, and so on.
Atlant
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Omar AKHAM
Sent: Friday, August 27, 2010 14:13 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] File Size human-readable ?
Hi all,
I'm looking for a Qt function to have a file size in human readable
format (size is returned by QFileInfo).
Thanks,
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.
Thank you.
Please consider the environment before printing this email.
More information about the Qt-interest-old
mailing list