PDA

View Full Version : How to find file using Qt?



rajeshs
1st January 2008, 11:48
Hi all,

I want to fiind file from my disk like CFindFile::findFile . and CFindFile::nextFile

How to achieve this?

I searched in qFileInfo , I didn't get any clear picture.

Please help me?

marcel
1st January 2008, 12:09
There are no such functions in Qt, but you can implement them very easy.
Take a look at QDir::entryList and QStringList::indexOf().
Given a directory and a file name, you should recursively parse the directory tree rooted at the given dir and search for the given file using the functions mentioned earlier.

jpn
1st January 2008, 14:07
Or use QDirIterator with name filter(s).