aguayro
19th August 2012, 21:17
Hi, i'm trying to read a entire file:
QFile lista(path);
if(!lista.open(QFile::ReadOnly))
{
QMessageBox msgBox;
msgBox.setText(tr("Could not open file.(2)"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
} else {
QTextStream strim(&lista);
while(!lista.atEnd()) {
qDebug() << strim.readLine();
}
}
lista.close();
But i can't read the last lines, it never read the last lines of files, sometimes 50, sometimes 100,.....
What can be wrong??
QFile lista(path);
if(!lista.open(QFile::ReadOnly))
{
QMessageBox msgBox;
msgBox.setText(tr("Could not open file.(2)"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
} else {
QTextStream strim(&lista);
while(!lista.atEnd()) {
qDebug() << strim.readLine();
}
}
lista.close();
But i can't read the last lines, it never read the last lines of files, sometimes 50, sometimes 100,.....
What can be wrong??