PDA

View Full Version : Retrieve file count in folder and subfolder



Talei
1st May 2010, 09:53
Hello,
Can someone point me a easy/fast way to traverse through directory structure, with sub folder, and retrieve file + folder count.
I know of QFileSystemModel but is there another way of ding it?

Best regards

squidge
1st May 2010, 10:11
Have a look at QDir

Talei
1st May 2010, 10:42
I know about QDir (I struggle with this atm.), but I'm to lazy to do recursive scan of the folders (this is probably something that the programmer shouldn't say :) ), so I thought maybe Qt offers some convenient function that does this for me :).
And I ask because sometimes I'm amazed when I find out that qt offers function/fu8nctionality that does "thing" for me.

Lykurg
1st May 2010, 19:43
you can use QDir::entryList() (filter = QDir::Dirs or QDir::Files or...) with QList::size()