ModeZt
11th April 2009, 14:38
I read the input text file line by line.
dataFile = new QFile(fileName);
dataFile->open(QIODevice::ReadOnly | QIODevice::Text);
dataStream = new QTextStream(dataFile);
while( !dataStream->atEnd() ) {
line = dataStream->readLine();
...
}
The file is > 200Mb.
I need to update a progress bar while i analize the lines.
I was going to use
100 * currentLine / numberOfLines
but how do i get the number of lines in the file?..
Thx!
dataFile = new QFile(fileName);
dataFile->open(QIODevice::ReadOnly | QIODevice::Text);
dataStream = new QTextStream(dataFile);
while( !dataStream->atEnd() ) {
line = dataStream->readLine();
...
}
The file is > 200Mb.
I need to update a progress bar while i analize the lines.
I was going to use
100 * currentLine / numberOfLines
but how do i get the number of lines in the file?..
Thx!