Re: Qtextstream::readline()
Quote:
Originally Posted by
dawn_to_dusk_
but i can't just go to a specific line or reverse the reading order.
That's because it's a stream, not an array of lines.
How big is that file?
Re: Qtextstream::readline()
about 4megabytes
i've half solved it using a linked list that stores the position on the file for each new line, but still can't put it reading the data in reverse order properly.
i think tomorow i'll manage it. Then i'll post the solution 8)
Re: Qtextstream::readline()
Quote:
Originally Posted by
dawn_to_dusk_
i've half solved it using a linked list that stores the position on the file for each new line,
It's a good approach, especially for big files. You can read smaller files (like yours) into a QStringList.
Quote:
Originally Posted by
dawn_to_dusk_
but still can't put it reading the data in reverse order properly.
If you have the positions, you can use QTextStream::seek().
Re: Qtextstream::readline()
yup, but there is something that is not allowing the reverse playback in the code and today is sunday... :cool:
thnks