QFile failing on readLine() on Windows
-
Hi,
There's something not clear, when you say it doesn't even read one line, do you mean that your application crashes or that the loop is not entered at all ?
-
Crashes. It successfully passes the
while (!in.atEnd()) {
and crashes on the next line. On Windows, it goes into "Not Responding" then exits.
I tried this:
while (!in.atEnd()) { QMessageBox(QMessageBox::Information, "test", "BEFORE",QMessageBox::Ok).exec(); line = in.readLine(); QMessageBox(QMessageBox::Information, "test", "AFTER",QMessageBox::Ok).exec(); ...
On Windows, I get the BEFORE message, then crash. On Mac and Linux, I get BEFORE and AFTER messages for each line in the script and no crash.
-
Pretty strange, can you reproduce it with a minimal compilable example ?
By the way, which version of Qt are you using ? -
http://sumrandomguy.com/TestReadLine.zip is the project
http://sumrandomguy.com/TestReadLine.exe is the compiled outputUsing Qt 5.4
-
Look like its not, the source link at least causes a 404