QTemporaryFile: clarify usage of the dynamic part of the file name

Pick-to: 6.7
Change-Id: I7d6b1b8a53f7b32bf223ac3435ec7c13c9326d10
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b4bb4449aea7592afdb9b9134bb90c40fe29735a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ahmad Samir 2024-07-04 03:06:54 +03:00 committed by Qt Cherry-pick Bot
parent ec349e0c00
commit fcfa245474

View File

@ -605,11 +605,12 @@ QString QTemporaryFilePrivate::defaultTemplateName()
as the temporary file itself was created on. as the temporary file itself was created on.
//! [note-about-rename-method] //! [note-about-rename-method]
Specified filenames can contain the following template \c XXXXXX The file name (the part after the last directory path separator in the
(six upper case "X" characters), which will be replaced by the specified file template) can contain the special sequence \c {"XXXXXX"}
auto-generated portion of the filename. Note that the template is (at least six upper case \c "X" characters), which will be replaced with
case sensitive. If the template is not present in the filename, the auto-generated portion of the file name. If the file name doesn't
QTemporaryFile appends the generated part to the filename given. contain \c {"XXXXXX"}, QTemporaryFile will append the generated part to the
file name. Only the first occurrence of \c {"XXXXXX"} will be considered.
\note On Linux, QTemporaryFile will attempt to create unnamed temporary \note On Linux, QTemporaryFile will attempt to create unnamed temporary
files. If that succeeds, open() will return true but exists() will be files. If that succeeds, open() will return true but exists() will be
@ -665,7 +666,8 @@ QTemporaryFile::QTemporaryFile()
//! [file-created-on-open] //! [file-created-on-open]
//! [dynamic-part-of-filename] //! [dynamic-part-of-filename]
If \a templateName doesn't contain \c {"XXXXXX"}, it will be added If the file name (the part after the last directory path separator in
\a templateName) doesn't contain \c {"XXXXXX"}, it will be added
automatically. automatically.
\c {"XXXXXX"} will be replaced with the dynamic part of the file name, \c {"XXXXXX"} will be replaced with the dynamic part of the file name,