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