View Single Post
Posts: 180 | Thanked: 76 times | Joined on May 2010
#128
Originally Posted by D-Iivil View Post
Problem (for me) is that most of the docs are written in the way that the writer assumes that reader already knows how things are working and therefore they are lacking the basic guides like:
1. create QFile "object" or what ever it's called
2. you must open the file with separate command so type file.open
3. do something with the file you just opened
etc etc....
Originally Posted by QFile Class Reference
The following example reads a text file line by line:

PHP Code:
QFile file("in.txt");
if (!
file.open(QIODevice::ReadOnly QIODevice::Text))
     return;

while (!
file.atEnd()) {
    
QByteArray line file.readLine();
    
process_line(line);

Sorry for this. :P