I have started to teach myself Qt. I have, in the lack of a better assignment, given myself the task to wirte a small program that searches several text files for a specific phrase. So far I've run into a small problem with QTextStream. The idea is that the program asks the user if he wishes to view the files being searched in a TextEdit in the mainwindow. I just can't seem to get it done right

Qt Code:
  1. QStringList::Iterator it = FilePath.begin(); //FilePath holds the filepaths
  2. QTextStream TextStream;
  3. QString Line;
  4. if (MsgBoxAnswer)
  5. {
  6. while(it != FilePath.end())
  7. {
  8. ui.txtOutput->append("Before TextStream"); //Test to see whether the program works so far
  9. TextStream << *it;
  10. while(!TextStream.atEnd())
  11. {
  12. ui.txtOutput->append("in TextStream"); //Test to see whether the program works so far
  13. Line = TextStream.readLine(0);
  14. ui.txtOutput->append(Line);
  15. }
  16. ++it;
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 

What is the matter? The program never enters the while(!TextStream.atEnd()) loop