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
main.cpp
Go to the documentation of this file.
1
// Copyright (C) 2019 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
"qpdfiohandler_p.h"
5
6
QT_BEGIN_NAMESPACE
7
8
class
QPdfPlugin
:
public
QImageIOPlugin
9
{
10
Q_OBJECT
11
Q_PLUGIN_METADATA(IID QImageIOHandlerFactoryInterface_iid FILE
"pdf.json"
)
12
13
public
:
14
Capabilities
capabilities
(
QIODevice
*
device
,
const
QByteArray
&
format
)
const
override
;
15
QImageIOHandler
*
create
(QIODevice *device,
const
QByteArray &format = QByteArray())
const
override
;
16
};
17
18
QImageIOPlugin::Capabilities
QPdfPlugin
::capabilities(QIODevice *device,
const
QByteArray &format)
const
19
{
20
if
(format ==
"pdf"
)
21
return
Capabilities(CanRead);
22
if
(!format.isEmpty())
23
return
{};
24
25
Capabilities cap;
26
if
(device->isReadable() && QPdfIOHandler::canRead(device))
27
cap |= CanRead;
28
return
cap;
29
}
30
31
QImageIOHandler
*
QPdfPlugin
::
create
(QIODevice *device,
const
QByteArray &format)
const
32
{
33
QPdfIOHandler *hand =
new
QPdfIOHandler();
34
hand->setDevice(device);
35
hand->setFormat(format);
36
return
hand;
37
}
38
39
QT_END_NAMESPACE
40
41
#
include
"main.moc"
QPdfPlugin
Definition
main.cpp:9
QPdfPlugin::create
QImageIOHandler * create(QIODevice *device, const QByteArray &format=QByteArray()) const override
Creates and returns a QImageIOHandler subclass, with device and format set.
Definition
main.cpp:31
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtwebengine
src
pdf
plugins
imageformats
pdf
main.cpp
Generated on
for Qt by
1.14.0