Although I didn't see it in the above code, does it contain something like the following? Code: file.open(QFile::ReadOnly); I did see some "if not opened in readonly" things in the last posts, but not an explicit .open() function. Or does a QFile open the file directly after declaring it? I thought that.. if it's not opened, nothing is read, and the QString stays empty.
file.open(QFile::ReadOnly);