C++ (Qt) QFile file( FilePath ); if ( file.open( IO_ReadOnly ) ) { QTextStream stream( &file ); while ( !stream.atEnd() ) { line = stream.readLine(); } file.close(); }