summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-12-12 15:09:25 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-12-16 23:37:15 +0000
commite8d64811962d618a188bdaa6f7f8ba7f03d8c991 (patch)
treebac5a6608ebfb5846a84c21c1a0171a477ef8290 /src/corelib
parent8509e0daae03cfd951bcc92a069a8992c8dc8d33 (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. Change-Id: I75c49cd3f6a1961bcaece4a92a4e479bb3300d36 Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c262a1805a062fd99abc890f58ea951da80ff0af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib')
-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 7ebc9c9bb6..988be643a4 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -319,6 +319,10 @@ void QBuffer::setData(const QByteArray &data)
/*!
\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)
{