From 0fa4af060e420f5c6213d45cdde8fb313f214672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 3 Mar 2023 14:49:05 +0100 Subject: QTemporaryFile: Add support for std::filesystem::path Since it hides QFile's overloads this was not supported for QTemporaryFile. [ChangeLog][QtCore][QTemporaryFile] Added support for passing std::filesystem::path to rename and createNativeFile. Change-Id: I909ff1d5b9c586824c9901d7dad278dfad09ffc3 Reviewed-by: Thiago Macieira --- src/corelib/io/qtemporaryfile.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qtemporaryfile.cpp') diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 80ea57fb92..a98256c1f4 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -630,6 +630,12 @@ QTemporaryFile::QTemporaryFile() { } +/*! + \fn QTemporaryFile::QTemporaryFile(const std::filesystem::path &templateName, QObject *parent) + \overload + \since 6.7 +*/ + /*! Constructs a QTemporaryFile with a template filename of \a templateName. Upon opening the temporary file this will be used to create @@ -791,6 +797,12 @@ QString QTemporaryFile::fileTemplate() const return d->templateName; } +/*! + \fn void QTemporaryFile::setFileTemplate(const std::filesystem::path &name) + \overload + \since 6.7 +*/ + /*! Sets the static portion of the file name to \a name. If the file template contains XXXXXX that will automatically be replaced with @@ -812,6 +824,12 @@ void QTemporaryFile::setFileTemplate(const QString &name) d->templateName = name; } +/*! + \fn bool QTemporaryFile::rename(const std::filesystem::path &newName) + \overload + \since 6.7 +*/ + /*! Renames the current temporary file to \a newName and returns true if it succeeded. @@ -860,7 +878,11 @@ bool QTemporaryFile::rename(const QString &newName) Works on the given \a fileName rather than an existing QFile object. */ - +/*! + \fn QTemporaryFile *QTemporaryFile::createNativeFile(const std::filesystem::path &fileName) + \overload + \since 6.7 +*/ /*! If \a file is not already a native file, then a QTemporaryFile is created -- cgit v1.2.3