Try with different files. Or make a simple test:
Second debug statement should display true.Qt Code:
bool t1 = file.atEnd(); qDebug() << t1; file.readAll(); t1 = file.atEnd(); qDebug() << t1;To copy to clipboard, switch view to plain text mode
Your current code is correct only when a file ends with an empty line, otherwise you won't be reading the last line.





Reply With Quote


Bookmarks