I thought you want search the coputer drives for a that folder and file. Can't see that your code is doing that.
Since you want to learn something a little bit more elaborate:
- Get all drive names (Like c:, d:, f: etc.)
- Construct the path depending on the drives
- Check for file.
QDir::drives returns a list of QFileInfos. See QList on how to iterate over a list. For each drive construct the path for drive (one list entry) and your specified folder and file name. (QDir::separator() is useful). Check if the file exist via QFile::exists(). If it exist, read it.
Bookmarks