Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
18
20{
22 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "mng.json")
23
24public:
25 Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
27};
28
29QImageIOPlugin::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
45{
46 QMngHandler *hand = new QMngHandler();
47 hand->setDevice(device);
48 hand->setFormat(format);
49 return hand;
50}
51
53
54#include "main.moc"
55
56#endif // !QT_NO_IMAGEFORMATPLUGIN
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QImageIOHandler class defines the common image I/O interface for all image formats in Qt.
\inmodule QtGui
bool canRead() const override
\reimp
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
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:29
Combined button and popup list for selecting options.
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLint GLsizei GLsizei GLenum format
GLenum cap
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)
view create()