Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
#
include
<
qimageiohandler
.
h
>
6
#
include
<
qstringlist
.
h
>
7
8
#
ifdef
QT_NO_IMAGEFORMAT_GIF
9
#
undef
QT_NO_IMAGEFORMAT_GIF
10
#
endif
11
#
include
<
qgifhandler_p
.
h
>
12
13
QT_BEGIN_NAMESPACE
14
15
class
QGifPlugin
:
public
QImageIOPlugin
16
{
17
Q_OBJECT
18
Q_PLUGIN_METADATA(IID
"org.qt-project.Qt.QImageIOHandlerFactoryInterface"
FILE
"gif.json"
)
19
public
:
20
QGifPlugin
();
21
~
QGifPlugin
();
22
23
Capabilities
capabilities
(QIODevice *device,
const
QByteArray &format)
const
override
;
24
QImageIOHandler
*
create
(QIODevice *device,
const
QByteArray &format = QByteArray())
const
override
;
25
};
26
27
QGifPlugin
::QGifPlugin()
28
{
29
}
30
31
QGifPlugin
::~
QGifPlugin
()
32
{
33
}
34
35
QImageIOPlugin
::
Capabilities
QGifPlugin
::
capabilities
(QIODevice *device,
const
QByteArray &format)
const
36
{
37
if
(format ==
"gif"
|| (device && device->isReadable() && QGifHandler::canRead(device)))
38
return
Capabilities(CanRead);
39
return
{ };
40
}
41
42
QImageIOHandler
*
QGifPlugin
::
create
(QIODevice *device,
const
QByteArray &format)
const
43
{
44
QImageIOHandler *handler =
new
QGifHandler;
45
handler->setDevice(device);
46
handler->setFormat(format);
47
return
handler;
48
}
49
50
QT_END_NAMESPACE
51
52
#
include
"main.moc"
QGifPlugin
Definition
main.cpp:16
QGifPlugin::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:42
QGifPlugin::capabilities
Capabilities capabilities(QIODevice *device, const QByteArray &format) const override
Returns the capabilities of the plugin, based on the data in device and the format format.
Definition
main.cpp:35
QGifPlugin::~QGifPlugin
~QGifPlugin()
Definition
main.cpp:31
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
plugins
imageformats
gif
main.cpp
Generated on
for Qt by
1.18.0