Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
src_corelib_io_qtemporaryfile.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
{
6
// Within a function/method...
7
8
QTemporaryFile
file
;
9
if
(
file
.
open
()) {
10
// file.fileName() returns the unique file name
11
}
12
13
// The QTemporaryFile destructor removes the temporary file
14
// as it goes out of scope.
16
}
17
19
QFile
f
(
":/resources/file.txt"
);
20
QTemporaryFile::createNativeFile
(
f
);
// Returns a pointer to a temporary file
21
22
QFile
f
(
"/users/qt/file.txt"
);
23
QTemporaryFile::createNativeFile
(
f
);
// Returns 0
QFile
\inmodule QtCore
Definition
qfile.h:93
QFile::open
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
Definition
qfile.cpp:881
QTemporaryFile
\inmodule QtCore \reentrant
Definition
qtemporaryfile.h:23
QTemporaryFile::createNativeFile
static QTemporaryFile * createNativeFile(const QString &fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition
qtemporaryfile.h:51
f
GLfloat GLfloat f
Definition
qopengles2ext.h:795
file
QFile file
[0]
Definition
src_corelib_io_qfile.cpp:5
f
QFile f(":/resources/file.txt")
[0]
qtbase
src
corelib
doc
snippets
code
src_corelib_io_qtemporaryfile.cpp
Generated by
1.9.7