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
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");
\inmodule QtCore
Definition qfile.h:93
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
Definition qfile.cpp:881
\inmodule QtCore \reentrant
static QTemporaryFile * createNativeFile(const QString &fileName)
This is an overloaded member function, provided for convenience. It differs from the above function o...
GLfloat GLfloat f
QFile file
[0]
QFile f(":/resources/file.txt")
[0]