qfile read txt file

    F the QFile ( " : D test data \\ \\ data \\ single beam buoy .TGT " ;) 
     IF (! F.open (a QIODevice the ReadOnly :: | :: a QIODevice the Text)) // open the specified file 
    { 
        a QMessageBox: : About (NULL, " file " , " file open failure " ); 
    } 
 
    the QTextStream txtInput ( & F); 
    QString lineStr; 
    the while (! txtInput.atEnd ()) 
    { 
        lineStr = txtInput.readLine ();   // read data 
        About :: a QMessageBox (NULL, " the field data " , lineStr); 
    }
 
    f.close();

【转】:https://blog.csdn.net/Giser_D/article/details/83149696

Guess you like

Origin www.cnblogs.com/hshy/p/11221212.html