HAL
hal::SvgIconEngine Class Reference

Creates Icons from svg data. More...

#include <svg_icon_engine.h>

Inheritance diagram for hal::SvgIconEngine:
Inheritance graph
Collaboration diagram for hal::SvgIconEngine:
Collaboration graph

Public Member Functions

 SvgIconEngine (const QByteArray &dataEnabled, const QByteArray &dataDisabled)
 
void paint (QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override
 
QIconEngineclone () const override
 
QPixmap pixmap (const QSize &size, QIcon::Mode mode, QIcon::State state) override
 
- Public Member Functions inherited from QIconEngine
 QIconEngine ()
 
virtual ~QIconEngine ()
 
virtual QSize actualSize (const QSize &size, QIcon::Mode mode, QIcon::State state)
 
virtual void addPixmap (const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state)
 
virtual void addFile (const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state)
 
virtual QString key () const const
 
virtual bool read (QDataStream &in)
 
virtual bool write (QDataStream &out) const const
 
virtual QList< QSizeavailableSizes (QIcon::Mode mode, QIcon::State state) const const
 
virtual QString iconName () const const
 
bool isNull () const const
 
QPixmap scaledPixmap (const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale)
 
virtual void virtual_hook (int id, void *data)
 

Additional Inherited Members

- Public Types inherited from QIconEngine
enum  IconEngineHook
 
- Public Attributes inherited from QIconEngine
 AvailableSizesHook
 
 IconNameHook
 
 IsNullHook
 
 ScaledPixmapHook
 

Detailed Description

Creates Icons from svg data.

The SvgIconEngine is a QIconEngine that is used for create QIcons from given svg data.

Definition at line 38 of file svg_icon_engine.h.

Constructor & Destructor Documentation

◆ SvgIconEngine()

hal::SvgIconEngine::SvgIconEngine ( const QByteArray dataEnabled,
const QByteArray dataDisabled 
)
explicit

Constructor.

Parameters
svg_data- The svg data to create the QIcon from

Definition at line 8 of file svg_icon_engine.cpp.

Referenced by clone().

Member Function Documentation

◆ clone()

QIconEngine * hal::SvgIconEngine::clone ( ) const
overridevirtual

Returns a clone of this icon engine

Returns
a clone of this icon engine

Implements QIconEngine.

Definition at line 21 of file svg_icon_engine.cpp.

References SvgIconEngine().

◆ paint()

void hal::SvgIconEngine::paint ( QPainter painter,
const QRect rect,
QIcon::Mode  mode,
QIcon::State  state 
)
overridevirtual

Uses the given painter to paint the icon into the rectangle rect. Mode and state are unused.

Parameters
painter- The painter to paint the icon with
rect- The rectangle to draw the icon in
mode- The mode (unused)
state- The state (unused)

Implements QIconEngine.

Definition at line 12 of file svg_icon_engine.cpp.

References QIcon::Disabled, QByteArray::isEmpty(), and hal::state.

Referenced by pixmap().

◆ pixmap()

QPixmap hal::SvgIconEngine::pixmap ( const QSize size,
QIcon::Mode  mode,
QIcon::State  state 
)
overridevirtual

Returns the icon as a pixmap with the required size. Mode and state are unused.

Parameters
size- The size of the pixmap
mode- The mode (unused)
state- The state (unused)
Returns
the pixmap for the icon

Reimplemented from QIconEngine.

Definition at line 26 of file svg_icon_engine.cpp.

References QImage::fill(), QImage::Format_ARGB32, QPixmap::fromImage(), Qt::NoFormatConversion, paint(), and hal::state.


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