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
#
ifndef
QT_NO_IMAGEFORMATPLUGIN
10
11
#
include
"qwebphandler_p.h"
12
13
#
include
<
qiodevice
.
h
>
14
#
include
<
qbytearray
.
h
>
15
16
QT_BEGIN_NAMESPACE
17
18
class
QWebpPlugin
:
public
QImageIOPlugin
19
{
20
Q_OBJECT
21
Q_PLUGIN_METADATA(IID
"org.qt-project.Qt.QImageIOHandlerFactoryInterface"
FILE
"webp.json"
)
22
23
public
:
24
Capabilities
capabilities
(
QIODevice
*
device
,
const
QByteArray
&
format
)
const
override
;
25
QImageIOHandler
*
create
(QIODevice *device,
const
QByteArray
&format = QByteArray())
const
override
;
26
};
27
28
QWebpPlugin::Capabilities
QWebpPlugin
::capabilities(QIODevice *device,
const
QByteArray &format)
const
29
{
30
if
(format ==
"webp"
)
31
return
Capabilities(CanRead | CanWrite);
32
33
Capabilities cap;
34
if
(!format.isEmpty())
35
return
cap;
36
if
(!device->isOpen())
37
return
cap;
38
39
if
(device->isReadable() && QWebpHandler::canRead(device))
40
cap |= CanRead;
41
if
(device->isWritable())
42
cap |= CanWrite;
43
44
return
cap;
45
}
46
47
QImageIOHandler *
QWebpPlugin
::create(QIODevice *device,
const
QByteArray &format)
const
48
{
49
QImageIOHandler *handler =
new
QWebpHandler;
50
handler->setDevice(device);
51
handler->setFormat(format);
52
return
handler;
53
}
54
55
QT_END_NAMESPACE
56
57
#
include
"main.moc"
58
59
#
endif
// !QT_NO_IMAGEFORMATPLUGIN
QByteArray::FromBase64Result
\inmodule QtCore
Definition
qbytearray.h:785
QWebpPlugin
Definition
main.cpp:19
QWebpPlugin::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:47
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
qtimageformats
src
plugins
imageformats
webp
main.cpp
Generated on
for Qt by
1.16.1