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