summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-12-12 15:09:25 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-12-14 19:07:19 +0100
commitc262a1805a062fd99abc890f58ea951da80ff0af (patch)
treee27b462c4786708a72057562fe931c4cd77dedde /src/corelib/io
parented623e63752af579ee0803669b19eb2c2820b32e (diff)
QBuffer: test and document open() behavior
QBuffer::open() was only documented as \reimp, so its behavior regarding WriteOnly was never actually described. Add a test and document the outcome. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I75c49cd3f6a1961bcaece4a92a4e479bb3300d36 Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qbuffer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp
index ba84428275..ba1ce7463b 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -288,6 +288,10 @@ void QBuffer::setData(const char *data, qsizetype size)
/*!
\reimp
+
+ Unlike QFile, opening a QBuffer QIODevice::WriteOnly does not truncate it.
+ However, pos() is set to 0. Use QIODevice::Append or QIODevice::Truncate to
+ change either behavior.
*/
bool QBuffer::open(OpenMode flags)
{