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#ifndef QT_NO_IMAGEFORMATPLUGIN
5
6#include "qmacjp2handler.h"
7
9
11{
13 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "macjp2.json")
14
15public:
16 Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
18};
19
20QImageIOPlugin::Capabilities QMacJp2Plugin::capabilities(QIODevice *device, const QByteArray &format) const
21{
22 if (format == "jp2")
23 return Capabilities(CanRead | CanWrite);
24 Capabilities cap;
25 if (!format.isEmpty())
26 return cap;
27 if (!device->isOpen())
28 return cap;
29
30 if (device->isReadable() && QMacJp2Handler::canRead(device))
31 cap |= CanRead;
32 if (device->isWritable())
33 cap |= CanWrite;
34 return cap;
35}
36
38{
39 QMacJp2Handler *handler = new QMacJp2Handler();
40 handler->setDevice(device);
41 handler->setFormat(format);
42 return handler;
43}
44
46
47#include "main.moc"
48
49#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.
void setDevice(QIODevice *device)
Sets the device of the QImageIOHandler to device.
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
\inmodule QtGui
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...
QImageIOHandler * create(QIODevice *device, const QByteArray &format=QByteArray()) const override
Creates and returns a QImageIOHandler subclass, with device and format set.
Definition main.cpp:37
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:20
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()