From eb44663eaa754c44dd11e403569cf33d6806304c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Wed, 4 Dec 2024 16:40:38 +0100 Subject: [PATCH] Doc: Improve QFile::open description Force the mentioned QIODeviceBase flags to be links. Use fully qualified name for the first flag mentioned, but use the short form for the rest to improve readability. Mark true and false to be written in code style. Task-number: QTBUG-131484 Pick-to: 6.8 Change-Id: Iebb0f9c6df382327bc5980e9e06c11deb6658291 Reviewed-by: Thiago Macieira (cherry picked from commit 647bee67150dedbd2a9fd2ddcd265d535e8fd8cf) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qfile.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 74b89d986c2..b427a0ef7ca 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -902,14 +902,14 @@ QFile::copy(const QString &fileName, const QString &newName) } /*! - Opens the file using OpenMode \a mode, returning true if successful; - otherwise false. + Opens the file using \a mode flags, returning \c true if successful; + otherwise returns \c false. - The \a mode must be QIODevice::ReadOnly, QIODevice::WriteOnly, or - QIODevice::ReadWrite. It may also have additional flags, such as - QIODevice::Text and QIODevice::Unbuffered. + The flags for \a mode must include \l QIODeviceBase::ReadOnly, + \l WriteOnly, or \l ReadWrite. It may also have additional flags, + such as \l Text and \l Unbuffered. - \note In \l{QIODevice::}{WriteOnly} or \l{QIODevice::}{ReadWrite} + \note In \l{WriteOnly} or \l{ReadWrite} mode, if the relevant file does not already exist, this function will try to create a new file before opening it. The file will be created with mode 0666 masked by the umask on POSIX systems, and @@ -918,9 +918,7 @@ QFile::copy(const QString &fileName, const QString &newName) of the file name, otherwise, it won't be possible to create this non-existing file. - \sa QT_USE_NODISCARD_FILE_OPEN - - \sa QIODevice::OpenMode, setFileName() + \sa QT_USE_NODISCARD_FILE_OPEN, setFileName() */ bool QFile::open(OpenMode mode) {