summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDheerendra Purohit <[email protected]>2025-07-04 12:08:26 +0530
committerDheerendra Purohit <[email protected]>2025-07-07 04:08:05 +0000
commitfde2ec282e4e7268379695ce0e50e53a21f53d2c (patch)
treed6dd9377231c5e83e7f48e706ea95efeb035436a
parent7d19da385a030363343bd9effb38ee877523971d (diff)
Doc: Clarify rename() does not disable autoremove in QTemporaryFileHEADdev
Added a note that renaming a temporary file does not prevent the renamed file from being deleted automatically. Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-132590 Change-Id: I5619c764e2331e433334f77f5a97dfe13d9544c9 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
-rw-r--r--src/corelib/io/qtemporaryfile.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 73e25c85ddf..038db4d857e 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -882,6 +882,11 @@ void QTemporaryFile::setFileTemplate(const QString &name)
be used for a similar purpose too, particularly if the destination file is
not temporary.
+ \note Calling rename() does not disable autoRemove. If you want the renamed
+ file to persist, you must call setAutoRemove and set it to \c false after
+ calling rename(). Otherwise, the file will be deleted when the QTemporaryFile
+ object is destroyed.
+
\sa QSaveFile, QSaveFile::commit(), QFile::rename()
*/
bool QTemporaryFile::rename(const QString &newName)