From bbf980e43f16c99504d75998217b88855edd3365 Mon Sep 17 00:00:00 2001 From: Rym Bouabid Date: Wed, 28 Aug 2024 14:32:22 +0200 Subject: [PATCH] QIODevice: improve QIODevice::readLine() documentation Pick-to: 6.8 6.7 6.5 Change-Id: I252c0faf982ff8328475243fdbc86cc4d1462498 Reviewed-by: Marc Mutz --- src/corelib/io/qiodevice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 67930863f2a..45af9ff476d 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1430,6 +1430,12 @@ qint64 QIODevicePrivate::readLine(char *data, qint64 maxSize) Reads a line from the device, but no more than \a maxSize characters, and returns the result as a byte array. + If \a maxSize is 0 or not specified, the line can be of any length, + thereby enabling unlimited reading. + + The resulting line can have trailing end-of-line characters ("\n" or "\r\n"), + so calling QByteArray::trimmed() may be necessary. + This function has no way of reporting errors; returning an empty QByteArray can mean either that no data was currently available for reading, or that an error occurred.