The following example is from QTextStream docs:
Qt Code:
  1. QTextStream stream(stdin);
  2. QString line;
  3. do {
  4. line = stream.readLine();
  5. } while (!line.isNull());
To copy to clipboard, switch view to plain text mode