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();
qfile read txt file
Guess you like
Origin www.cnblogs.com/hshy/p/11221212.html
Recommended
Ranking