From 552195792dcc5ab9f955b04bca408602a3ef9709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Mon, 25 Nov 2024 14:57:05 +0100 Subject: [PATCH] Doc: Fix incorrect mentioning of read*() methods in QSaveFile QSaveFile can only be used with WriteOnly. Calling any read method will print a runtime warning: QIODevice::read (QSaveFile): WriteOnly device Change-Id: Id721e4e1cba4b81c5504e3eff66420d363436010 Reviewed-by: Thiago Macieira (cherry picked from commit 439654cbd19b5a9bcc60cb9f82e84bab4fc562ab) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qsavefile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp index 96ab6e4c05d..073992264af 100644 --- a/src/corelib/io/qsavefile.cpp +++ b/src/corelib/io/qsavefile.cpp @@ -57,8 +57,8 @@ QSaveFilePrivate::~QSaveFilePrivate() an error happened, and will discard the temporary file in commit(). Much like with QFile, the file is opened with open(). Data is usually read - and written using QDataStream or QTextStream, but you can also call the - QIODevice-inherited functions read(), readLine(), readAll(), write(). + and written using QDataStream or QTextStream, but you can also directly call + \l write(). Unlike QFile, calling close() is not allowed. commit() replaces it. If commit() was not called and the QSaveFile instance is destroyed, the temporary file is