[Qt-interest] Qt show folder size
Andrei Sebastian Cimpean
andreiamenta at gmail.com
Fri Sep 18 14:17:56 CEST 2009
On Friday 18 September 2009 02:52:28 pm Sean Harmer wrote:
> On Friday 18 Sep 2009 12:09:02 Andrei Sebastian Cimpean wrote:
> > This returns a standard size around 4 kb:
> > QString::number(fileorfolder.size(),10)
> > Does anyone know how to get the sum of all the items inside the folder?
> > Thank you
>
> Yes, iterate through them and sum the sizes. Should be trivial with
> QDirIterator and QFileInfo.
>
> Sean
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
How fast is this way of doing it? I mean for a folder with 100k the number of
subfolders and files wouldn't it take ages?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090918/a7474eaf/attachment.bin
More information about the Qt-interest-old
mailing list