4#ifndef QTEMPORARYFILE_H
5#define QTEMPORARYFILE_H
7#include <QtCore/qiodevice.h>
8#include <QtCore/qfile.h>
11#error qtemporaryfile.h must be included before any header file that defines open
17#if QT_CONFIG(temporaryfile)
19class QTemporaryFilePrivate;
22class Q_CORE_EXPORT QTemporaryFile :
public QFile
27 Q_DECLARE_PRIVATE(QTemporaryFile)
31 explicit QTemporaryFile(
const QString &templateName);
33 explicit QTemporaryFile(
QObject *parent);
36# if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
38 explicit QTemporaryFile(
const std::filesystem::path &templateName,
QObject *parent =
nullptr)
39 : QTemporaryFile(
QtPrivate::fromFilesystemPath(templateName), parent)
47 bool autoRemove()
const;
48 void setAutoRemove(
bool b);
56#if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
58 void setFileTemplate(
const std::filesystem::path &
name)
60 return setFileTemplate(QtPrivate::fromFilesystemPath(
name));
65 bool rename(
const QString &newName);
67#if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
69 bool rename(
const std::filesystem::path &newName)
71 return rename(QtPrivate::fromFilesystemPath(newName));
77 static QTemporaryFile *createNativeFile(
QFile &
file);
79#if QT_CONFIG(cxx17_filesystem) || defined(Q_QDOC)
81 static QTemporaryFile *createNativeFile(
const std::filesystem::path &
fileName)
84 return createNativeFile(
file);
94 Q_DISABLE_COPY(QTemporaryFile)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
#define QFILE_MAYBE_NODISCARD
GLboolean GLboolean GLboolean b
file open(QIODevice::ReadOnly)