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
6#ifndef QT_NO_IMAGEFORMATPLUGIN
7
8#ifdef QT_NO_IMAGEFORMAT_WBMP
9#undef QT_NO_IMAGEFORMAT_WBMP
10#endif
11
12#include "qwbmphandler_p.h"
13
15
17{
19 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "wbmp.json")
20
21public:
22 QImageIOPlugin::Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
24};
25
26QImageIOPlugin::Capabilities QWbmpPlugin::capabilities(QIODevice *device, const QByteArray &format) const
27{
28 if (format == "wbmp")
29 return Capabilities(CanRead | CanWrite);
30
31 Capabilities cap;
32 if (!format.isEmpty())
33 return cap;
34
35 if (!device->isOpen())
36 return cap;
37
38 if (device->isReadable() && QWbmpHandler::canRead(device))
39 cap |= CanRead;
40
41 if (device->isWritable())
42 cap |= CanWrite;
43
44 return cap;
45}
46
48{
49 QImageIOHandler *handler = new QWbmpHandler(device);
50
51 handler->setFormat(format);
52 return handler;
53}
54
56
57#include "main.moc"
58
59#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 setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
\inmodule QtGui
The QWbmpHandler class provides support for the WBMP image format.
bool canRead() const override
Verifies if some values (magic bytes) are set as expected in the header of the file.
QImageIOHandler * create(QIODevice *device, const QByteArray &format=QByteArray()) const override
Creates and returns a QImageIOHandler subclass, with device and format set.
Definition main.cpp:47
QImageIOPlugin::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:26
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()