Doc: Fix QTextStream::readLine() snippet

The old snippet is incomplete because it misses an extra check
in the loop body that the line is not null.
Use the new readLine() overload to keep it simple.

Change-Id: Ie9f13291ca6ff6f546b81f100ce58d747f0dd12f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
bb10
Alexander Volkov 2015-01-22 13:31:19 +03:00
parent 2d9c2a0b08
commit 72d5c84407
1 changed files with 3 additions and 3 deletions

View File

@ -51,9 +51,9 @@ if (data.open(QFile::WriteOnly | QFile::Truncate)) {
//! [1]
QTextStream stream(stdin);
QString line;
do {
line = stream.readLine();
} while (!line.isNull());
while (stream.readLine(&line)) {
...
}
//! [1]