Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpdffile.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qpdffile_p.h"
5#include <QThread>
6
8
9/*!
10 \internal
11 \class QPdfFile
12 \inmodule QtPdf
13
14 QPdfFile is a means of passing a PDF file along with the associated
15 QPdfDocument together into QPdfIOHandler::load(QIODevice *device) so that
16 QPdfIOHandler does not need to construct its own redundant QPdfDocument
17 instance. If it succeeds in casting the QIODevice to a QPdfFile, it is
18 expected to use the QPdfDocument operations for all I/O, and thus the
19 normal QFile I/O functions are not needed for that use case.
20*/
21
22QPdfFile::QPdfFile(QPdfDocument *doc)
23 : QFile(doc->fileName()), m_document(doc)
24{
25 // Give up thread affinity: it may be created in one thread, rendered in
26 // another, and deleted in another. The rendering thread needs to be able
27 // to "pull" the affinity to itself. If deleteLater() is used, then
28 // the affinity _must_ be changed to avoid a memory leak!
29 moveToThread(nullptr);
30}
31
32QT_END_NAMESPACE
33
34//#include "moc_qpdffile_p.cpp"