![]() |
Qt 6.x
The Qt SDK
|
The QtIcoHandler class provides support for the ICO image format. More...
#include <qicohandler.h>
Public Member Functions | |
QtIcoHandler (QIODevice *device) | |
Constructs an instance of QtIcoHandler initialized to use device. | |
virtual | ~QtIcoHandler () |
Destructor for QtIcoHandler. | |
bool | canRead () const override |
Verifies if some values (magic bytes) are set as expected in the header of the file. | |
bool | read (QImage *image) override |
\reimp | |
bool | write (const QImage &image) override |
\reimp | |
int | imageCount () const override |
\reimp | |
bool | jumpToImage (int imageNumber) override |
\reimp | |
bool | jumpToNextImage () override |
\reimp | |
bool | supportsOption (ImageOption option) const override |
Returns true if the QImageIOHandler supports the option option; otherwise returns false . | |
QVariant | option (ImageOption option) const override |
Returns the value assigned to option as a QVariant. | |
![]() | |
QImageIOHandler () | |
Constructs a QImageIOHandler object. | |
virtual | ~QImageIOHandler () |
Destructs the QImageIOHandler object. | |
void | setDevice (QIODevice *device) |
Sets the device of the QImageIOHandler to device. | |
QIODevice * | device () const |
Returns the device currently assigned to the QImageIOHandler. | |
void | setFormat (const QByteArray &format) |
Sets the format of the QImageIOHandler to format. | |
void | setFormat (const QByteArray &format) const |
Sets the format of the QImageIOHandler to format. | |
QByteArray | format () const |
Returns the format that is currently assigned to QImageIOHandler. | |
virtual bool | canRead () const =0 |
Returns true if an image can be read from the device (i.e., the image format is supported, the device can be read from and the initial header information suggests that the image can be read); otherwise returns false . | |
virtual bool | read (QImage *image)=0 |
Read an image from the device, and stores it in image. | |
virtual bool | write (const QImage &image) |
Writes the image image to the assigned device. | |
virtual QVariant | option (ImageOption option) const |
Returns the value assigned to option as a QVariant. | |
virtual void | setOption (ImageOption option, const QVariant &value) |
Sets the option option with the value value. | |
virtual bool | supportsOption (ImageOption option) const |
Returns true if the QImageIOHandler supports the option option; otherwise returns false . | |
virtual bool | jumpToNextImage () |
For image formats that support animation, this function jumps to the next image. | |
virtual bool | jumpToImage (int imageNumber) |
For image formats that support animation, this function jumps to the image whose sequence number is imageNumber. | |
virtual int | loopCount () const |
For image formats that support animation, this function returns the number of times the animation should loop. | |
virtual int | imageCount () const |
For image formats that support animation, this function returns the number of images in the animation. | |
virtual int | nextImageDelay () const |
For image formats that support animation, this function returns the number of milliseconds to wait until reading the next image. | |
virtual int | currentImageNumber () const |
For image formats that support animation, this function returns the sequence number of the current image in the animation. | |
virtual QRect | currentImageRect () const |
Returns the rect of the current image. | |
Static Public Member Functions | |
static bool | canRead (QIODevice *device) |
This static function is used by the plugin code, and is provided for convenience only. | |
![]() | |
static bool | allocateImage (QSize size, QImage::Format format, QImage *image) |
The QtIcoHandler class provides support for the ICO image format.
Definition at line 11 of file qicohandler.h.
QtIcoHandler::QtIcoHandler | ( | QIODevice * | device | ) |
Constructs an instance of QtIcoHandler initialized to use device.
Definition at line 681 of file qicohandler.cpp.
References QImageIOHandler::device(), and QImageIOHandler::setDevice().
|
virtual |
Destructor for QtIcoHandler.
Definition at line 691 of file qicohandler.cpp.
|
overridevirtual |
Verifies if some values (magic bytes) are set as expected in the header of the file.
If the magic bytes were found, it is assumed that the QtIcoHandler can read the file.
Implements QImageIOHandler.
Definition at line 736 of file qicohandler.cpp.
References ICOReader::canRead(), QImageIOHandler::device(), qCWarning, and QImageIOHandler::setFormat().
Referenced by QICOPlugin::capabilities().
|
static |
This static function is used by the plugin code, and is provided for convenience only.
device must be an opened device with pointing to the start of the header data of the ICO file.
Definition at line 753 of file qicohandler.cpp.
References ICOReader::canRead(), QImageIOHandler::device(), and Q_ASSERT.
|
overridevirtual |
\reimp
Reimplemented from QImageIOHandler.
Definition at line 791 of file qicohandler.cpp.
References ICOReader::count().
Referenced by jumpToImage().
|
overridevirtual |
\reimp
Reimplemented from QImageIOHandler.
Definition at line 799 of file qicohandler.cpp.
References imageCount().
Referenced by jumpToNextImage().
|
overridevirtual |
\reimp
Reimplemented from QImageIOHandler.
Definition at line 812 of file qicohandler.cpp.
References jumpToImage().
|
overridevirtual |
Returns the value assigned to option as a QVariant.
The type of the value depends on the option. For example, option(Size) returns a QSize variant.
Reimplemented from QImageIOHandler.
Definition at line 696 of file qicohandler.cpp.
References QImage::Format_ARGB32, QImage::Format_Indexed8, QImage::Format_Mono, QImage::Format_RGB32, QImageIOHandler::ImageFormat, ICOReader::readIconEntry(), and QImageIOHandler::Size.
|
overridevirtual |
\reimp
Implements QImageIOHandler.
Definition at line 762 of file qicohandler.cpp.
References ICOReader::iconAt().
|
overridevirtual |
Returns true
if the QImageIOHandler supports the option option; otherwise returns false
.
For example, if the QImageIOHandler supports the \l Size option, supportsOption(Size) must return true.
Reimplemented from QImageIOHandler.
Definition at line 726 of file qicohandler.cpp.
References QImageIOHandler::ImageFormat, and QImageIOHandler::Size.
|
overridevirtual |
\reimp
Reimplemented from QImageIOHandler.
Definition at line 780 of file qicohandler.cpp.
References QList< T >::append(), QImageIOHandler::device(), and ICOReader::write().