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#ifdef QT_NO_IMAGEFORMAT_GIF
8#undef QT_NO_IMAGEFORMAT_GIF
9#endif
10#include <qgifhandler_p.h>
11
13
15{
17 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "gif.json")
18public:
19 QGifPlugin();
21
22 Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
24};
25
29
33
34QImageIOPlugin::Capabilities QGifPlugin::capabilities(QIODevice *device, const QByteArray &format) const
35{
36 if (format == "gif" || (device && device->isReadable() && QGifHandler::canRead(device)))
37 return Capabilities(CanRead);
38 return { };
39}
40
42{
43 QImageIOHandler *handler = new QGifHandler;
44 handler->setDevice(device);
45 handler->setFormat(format);
46 return handler;
47}
48
50
51#include "main.moc"
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
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:41
QGifPlugin()
Definition main.cpp:26
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:34
~QGifPlugin()
Definition main.cpp:30
\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
Combined button and popup list for selecting options.
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLint GLsizei GLsizei GLenum format
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)
view create()