From 133af018d506ca812fb4c27a951e28e749c68a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Fri, 22 Nov 2024 13:20:47 +0100 Subject: [PATCH] Doc: Improve QSaveFile::open description Force the mentioned QIODevice flags to be links. Use fully qualified name for the first flag mentioned, but use the short form for the following ones for better readability. Mark true and false to be written in code style. Task-number: QTBUG-131484 Change-Id: I988ba66341b811c815953e5fd6d067204bdaae6c Reviewed-by: Thiago Macieira (cherry picked from commit 5a6a9b1d5aa4a9314c09dcbc85dcc9c863ace7f5) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qsavefile.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp index cc59bb37251..96ab6e4c05d 100644 --- a/src/corelib/io/qsavefile.cpp +++ b/src/corelib/io/qsavefile.cpp @@ -143,16 +143,15 @@ void QSaveFile::setFileName(const QString &name) } /*! - Opens the file using OpenMode \a mode, returning true if successful; - otherwise false. + Opens the file using \a mode flags. Returns \c true if successful; + otherwise returns \c false. - Important: the \a mode must include QIODevice::WriteOnly. - It may also have additional flags, such as QIODevice::Text and QIODevice::Unbuffered. + Important: The flags for \a mode must include \l QIODeviceBase::WriteOnly. Other + common flags you can use are \l Text and \l Unbuffered. Flags not supported at the + moment are \l ReadOnly (and therefore \l ReadWrite), \l Append, \l NewOnly and \l ExistingOnly; + they will generate a runtime warning. - QIODevice::ReadWrite, QIODevice::Append, QIODevice::NewOnly and - QIODevice::ExistingOnly are not supported at the moment. - - \sa QIODevice::OpenMode, setFileName(), QT_USE_NODISCARD_FILE_OPEN + \sa setFileName(), QT_USE_NODISCARD_FILE_OPEN */ bool QSaveFile::open(OpenMode mode) {