QTemporaryFile: de-duplicate docs wrt. the file name relative/absolute

Make it clearer in fileTemplate() and fileName() that the returned path
will be relative or absolute depending on the specified file name
template.

Task-number: QTBUG-124653
Pick-to: 6.8 6.7
Change-Id: Iccb7a6d0ced2cadeacea7d14d3f6e924705b4d58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2024-07-01 20:53:48 +03:00
parent 6ccdb030ae
commit 9a5e3e1f40
1 changed files with 14 additions and 7 deletions

View File

@ -672,9 +672,12 @@ QTemporaryFile::QTemporaryFile()
which is calculated to be unique.
//! [dynamic-part-of-filename]
//! [filename-relative-or-absolute-path]
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
templateName if you want use the system's temporary directory.
//! [filename-relative-or-absolute-path]
\include qtemporaryfile.cpp note-about-rename-method
\sa open(), fileTemplate()
@ -704,9 +707,7 @@ QTemporaryFile::QTemporaryFile(QObject *parent)
\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
templateName if you want use the system's temporary directory.
\include qtemporaryfile.cpp filename-relative-or-absolute-path
\include qtemporaryfile.cpp note-about-rename-method
\sa open(), fileTemplate()
@ -791,6 +792,10 @@ void QTemporaryFile::setAutoRemove(bool b)
afterwards it will contain the fileTemplate() plus
additional characters to make it unique.
The file name returned by this method is relative or absolute depending on
the file name template used to construct this object (or passed to
setFileTemplate()) being relative or absolute, respectively.
\sa fileTemplate()
*/
@ -809,6 +814,10 @@ QString QTemporaryFile::fileName() const
/*!
Returns the file name template.
The file name template returned by this method, will be relative or
absolute depending on the file name template used to construct this object
(or passed to setFileTemplate()) being relative or absolute, respectively.
\sa setFileTemplate(), fileName(), {Default File Name Template}
*/
QString QTemporaryFile::fileTemplate() const
@ -830,12 +839,10 @@ QString QTemporaryFile::fileTemplate() const
\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
name if you want use the system's temporary directory.
\include qtemporaryfile.cpp filename-relative-or-absolute-path
\include qtemporaryfile.cpp note-about-rename-method
\sa fileTemplate()
\sa fileTemplate(), fileName()
*/
void QTemporaryFile::setFileTemplate(const QString &name)
{