-rw-r--r-- | qmake/tools/qfile.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qmake/tools/qfile.cpp b/qmake/tools/qfile.cpp index a578b49..c088b55 100644 --- a/qmake/tools/qfile.cpp +++ b/qmake/tools/qfile.cpp @@ -85,13 +85,13 @@ extern bool qt_file_access( const QString& fn, int t ); QStringList lines; QFile file( "file.txt" ); if ( file.open( IO_ReadOnly ) ) { QTextStream stream( &file ); QString line; int i = 1; - while ( !stream.eof() ) { + while ( !stream.atEnd() ) { line = stream.readLine(); // line of text excluding '\n' printf( "%3d: %s\n", i++, line.latin1() ); lines += line; } file.close(); } @@ -287,12 +287,13 @@ void QFile::flush() /*! \reimp \fn QIODevice::Offset QFile::at() const */ /*! Returns TRUE if the end of file has been reached; otherwise returns FALSE. + If QFile has not been open()'d, then the behavior is undefined. \sa size() */ bool QFile::atEnd() const { |