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
parent
2d9c2a0b08
commit
72d5c84407
|
|
@ -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]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue