From 7ad780e6f556026d8b6d94734d15cf1aa7e2dd4d Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 1 Jul 2024 01:24:26 +0300 Subject: [PATCH] QTemporaryFile: de-duplicate API docs wrt. XXXXXX template usage Pick-to: 6.7 Change-Id: I6180d82aab65788b897df4410d13e68f221193cb Reviewed-by: Ivan Solovev Reviewed-by: Thiago Macieira (cherry picked from commit 6ccdb030ae8c604e6674d406036ad980f7767e45) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qtemporaryfile.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 201ddf35abe..589f45cc1b9 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -661,8 +661,13 @@ QTemporaryFile::QTemporaryFile() templateName. Upon opening the temporary file this will be used to create a unique filename. - If the \a templateName does not contain XXXXXX it will automatically be - appended and used as the dynamic portion of the filename. +//! [dynamic-part-of-filename] + If \a templateName doesn't contain \c {"XXXXXX"}, it will be added + automatically. + + \c {"XXXXXX"} will be replaced with the dynamic part of the file name, + which is calculated to be unique. +//! [dynamic-part-of-filename] If \a templateName is a relative path, the path will be relative to the current working directory. You can use QDir::tempPath() to construct \a @@ -694,8 +699,7 @@ QTemporaryFile::QTemporaryFile(QObject *parent) Upon opening the temporary file this will be used to create a unique filename. - If the \a templateName does not contain XXXXXX it will automatically be - appended and used as the dynamic portion of the filename. + \include qtemporaryfile.cpp dynamic-part-of-filename If \a templateName is a relative path, the path will be relative to the current working directory. You can use QDir::tempPath() to construct \a @@ -817,10 +821,11 @@ QString QTemporaryFile::fileTemplate() const */ /*! - Sets the static portion of the file name to \a name. If the file - template contains XXXXXX that will automatically be replaced with - the unique part of the filename, otherwise a filename will be - determined automatically based on the static portion specified. + \fn void QTemporaryFile::setFileTemplate(const QString &templateName) + + Sets the file name template to \a templateName. + + \include qtemporaryfile.cpp dynamic-part-of-filename If \a name contains a relative file path, the path will be relative to the current working directory. You can use QDir::tempPath() to construct \a