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