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) 2016 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
// Qt-Security score:significant reason:default
4
5
6
#
include
<
qimageiohandler
.
h
>
7
#
include
<
qstringlist
.
h
>
8
9
#
if
!
defined
(
QT_NO_SVGRENDERER
)
10
11
#
include
"qsvgiohandler.h"
12
13
#
include
<
qiodevice
.
h
>
14
#
include
<
qbytearray
.
h
>
15
#
include
<
qdebug
.
h
>
16
17
QT_BEGIN_NAMESPACE
18
19
class
QSvgPlugin
:
public
QImageIOPlugin
20
{
21
Q_OBJECT
22
#
ifndef
QT_NO_COMPRESS
23
Q_PLUGIN_METADATA(IID
"org.qt-project.Qt.QImageIOHandlerFactoryInterface"
FILE
"svg.json"
)
24
#
else
25
Q_PLUGIN_METADATA
(
IID
"org.qt-project.Qt.QImageIOHandlerFactoryInterface"
FILE
"svg-nocompress.json"
)
26
#
endif
27
28
public
:
29
Capabilities
capabilities
(
QIODevice
*
device
,
const
QByteArray
&
format
)
const
override
;
30
QImageIOHandler
*
create
(QIODevice *device,
const
QByteArray
&format = QByteArray())
const
override
;
31
};
32
33
QImageIOPlugin::Capabilities
QSvgPlugin
::capabilities(QIODevice *device,
const
QByteArray
&format)
const
34
{
35
#
ifndef
QT_NO_COMPRESS
36
if
(format ==
"svg"
|| format ==
"svgz"
)
37
#
else
38
if
(format ==
"svg"
)
39
#
endif
40
return
Capabilities(CanRead);
41
Capabilities cap;
42
if
(!format.isEmpty())
43
return
cap;
44
if
(device->isReadable() && QSvgIOHandler::canRead(device))
45
cap |= CanRead;
46
return
cap;
47
}
48
49
QImageIOHandler
*
QSvgPlugin
::
create
(QIODevice *device,
const
QByteArray
&format)
const
50
{
51
QSvgIOHandler
*hand =
new
QSvgIOHandler
(
)
;
52
hand->setDevice(device);
53
hand->setFormat(format);
54
return
hand;
55
}
56
57
QT_END_NAMESPACE
58
59
#
include
"main.moc"
60
61
#
endif
// !QT_NO_IMAGEFORMATPLUGIN
QByteArray::FromBase64Result
\inmodule QtCore
Definition
qbytearray.h:785
QSvgIOHandler
Definition
qsvgiohandler.h:22
QSvgIOHandler::QSvgIOHandler
QSvgIOHandler()
Definition
qsvgiohandler.cpp:78
QSvgPlugin
Definition
main.cpp:20
QSvgPlugin::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:49
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
qtsvg
src
plugins
imageformats
svg
main.cpp
Generated on
for Qt by
1.16.1