Did you checked the file names you are trying to open?
If you do so, you might notice that those are the plain file names without path. Then
QFile
tries to open the file in the current directory which is probably not the one passed to
QDir
.
To get the full names with path you must use
QDir::entryInfoList
:
foreach (QFileInfo fileInfo, dir.entryInfoList(filters, QDir::Files) )
{
QFile readFile(fileInfo.absoluteFilePath());