Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QtIcoHandler Class Reference

The QtIcoHandler class provides support for the ICO image format. More...

#include <qicohandler.h>

Inheritance diagram for QtIcoHandler:
Collaboration diagram for QtIcoHandler:

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.
Public Member Functions inherited from QImageIOHandler
 QImageIOHandler ()
 Constructs a QImageIOHandler object.
virtual ~QImageIOHandler ()
 Destructs the QImageIOHandler object.
void setDevice (QIODevice *device)
 Sets the device of the QImageIOHandler to device.
QIODevicedevice () 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 void setOption (ImageOption option, const QVariant &value)
 Sets the option option with the value value.
virtual int loopCount () const
 For image formats that support animation, this function returns the number of times the animation should loop.
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 Public Member Functions inherited from QImageIOHandler
static bool allocateImage (QSize size, QImage::Format format, QImage *image)

Additional Inherited Members

Public Types inherited from QImageIOHandler
enum  ImageOption {
  Size , ClipRect , Description , ScaledClipRect ,
  ScaledSize , CompressionRatio , Gamma , Quality ,
  Name , SubType , IncrementalReading , Endianness ,
  Animation , BackgroundColor , ImageFormat , SupportedSubTypes ,
  OptimizedWrite , ProgressiveScanWrite , ImageTransformation
}
 This enum describes the different options supported by QImageIOHandler. More...
enum  Transformation {
  TransformationNone = 0 , TransformationMirror = 1 , TransformationFlip = 2 , TransformationRotate180 = TransformationMirror | TransformationFlip ,
  TransformationRotate90 = 4 , TransformationMirrorAndRotate90 = TransformationMirror | TransformationRotate90 , TransformationFlipAndRotate90 = TransformationFlip | TransformationRotate90 , TransformationRotate270 = TransformationRotate180 | TransformationRotate90
}
Protected Member Functions inherited from QImageIOHandler
 QImageIOHandler (QImageIOHandlerPrivate &dd)
Protected Attributes inherited from QImageIOHandler
QScopedPointer< QImageIOHandlerPrivated_ptr

Detailed Description

The QtIcoHandler class provides support for the ICO image format.

Since
4.4

Definition at line 11 of file qicohandler.h.

Constructor & Destructor Documentation

◆ QtIcoHandler()

QtIcoHandler::QtIcoHandler ( QIODevice * device)

Constructs an instance of QtIcoHandler initialized to use device.

Definition at line 682 of file qicohandler.cpp.

◆ ~QtIcoHandler()

QtIcoHandler::~QtIcoHandler ( )
virtual

Destructor for QtIcoHandler.

Definition at line 692 of file qicohandler.cpp.

Member Function Documentation

◆ canRead() [1/2]

bool QtIcoHandler::canRead ( ) const
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 737 of file qicohandler.cpp.

◆ canRead() [2/2]

bool QtIcoHandler::canRead ( QIODevice * device)
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 757 of file qicohandler.cpp.

◆ imageCount()

int QtIcoHandler::imageCount ( ) const
overridevirtual

\reimp

Reimplemented from QImageIOHandler.

Definition at line 795 of file qicohandler.cpp.

References ICOReader::count().

Referenced by jumpToImage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jumpToImage()

bool QtIcoHandler::jumpToImage ( int imageNumber)
overridevirtual

\reimp

Reimplemented from QImageIOHandler.

Definition at line 803 of file qicohandler.cpp.

References imageCount().

Referenced by jumpToNextImage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jumpToNextImage()

bool QtIcoHandler::jumpToNextImage ( )
overridevirtual

\reimp

Reimplemented from QImageIOHandler.

Definition at line 816 of file qicohandler.cpp.

References jumpToImage().

Here is the call graph for this function:

◆ option()

QVariant QtIcoHandler::option ( ImageOption option) const
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.

See also
setOption(), supportsOption()

Reimplemented from QImageIOHandler.

Definition at line 697 of file qicohandler.cpp.

References ICOReader::readIconEntry().

Here is the call graph for this function:

◆ read()

bool QtIcoHandler::read ( QImage * image)
overridevirtual

\reimp

Implements QImageIOHandler.

Definition at line 766 of file qicohandler.cpp.

◆ supportsOption()

bool QtIcoHandler::supportsOption ( ImageOption option) const
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.

See also
setOption(), option()

Reimplemented from QImageIOHandler.

Definition at line 727 of file qicohandler.cpp.

◆ write()

bool QtIcoHandler::write ( const QImage & image)
overridevirtual

\reimp

Reimplemented from QImageIOHandler.

Definition at line 784 of file qicohandler.cpp.


The documentation for this class was generated from the following files: