NDEVR
API Documentation
DeferredImageIconEngine

Used to render any icons when they are needed. More...

Collaboration diagram for DeferredImageIconEngine:
[legend]

Public Member Functions

 DeferredImageIconEngine (const StringView &icon, QIcon::Mode mode=QIcon::Mode::Normal)
 Constructs a deferred icon engine that delays resource loading until paint time.
QSize actualSize (const QSize &size, QIcon::Mode mode, QIcon::State state) override
 Returns the actual rendered size for the given constraints.
virtual QIconEngine * clone (void) const override
 Creates a copy of this icon engine.
virtual void paint (QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override
 Paints the icon into the given rectangle using the specified painter.
virtual QPixmap pixmap (const QSize &size, QIcon::Mode mode, QIcon::State state) override
 Returns a pixmap for the icon at the specified size, mode, and state.
void setIcon (const StringView &icon)
 Changes the icon resource identifier.
void setIconTheme (const IconThemeSettings theme)
 Sets the icon theme to use for rendering.

Public Attributes

QPixmap m_cached_pixmap
 Cached pixmap to avoid redundant rendering.
QSize m_default_size
 The default size determined from the icon resource.
String m_icon
 The icon resource identifier.
QIcon::Mode m_override_mode
 The icon mode override for rendering.

Detailed Description

Used to render any icons when they are needed.


Resources will not be consumed until draw is called.

Definition at line 146 of file QTIconManager.h.

Constructor & Destructor Documentation

◆ DeferredImageIconEngine()

DeferredImageIconEngine::DeferredImageIconEngine ( const StringView & icon,
QIcon::Mode mode = QIcon::Mode::Normal )

Constructs a deferred icon engine that delays resource loading until paint time.

Parameters
[in]iconThe icon resource identifier.
[in]modeThe icon mode to use when rendering.

References DeferredImageIconEngine().

Referenced by DeferredImageIconEngine().

Member Function Documentation

◆ actualSize()

QSize DeferredImageIconEngine::actualSize ( const QSize & size,
QIcon::Mode mode,
QIcon::State state )
override

Returns the actual rendered size for the given constraints.

Parameters
[in]sizeThe maximum available size.
[in]modeThe icon mode.
[in]stateThe icon state.
Returns
The actual size the icon will be rendered at.

◆ clone()

virtual QIconEngine * DeferredImageIconEngine::clone ( void ) const
overridevirtual

Creates a copy of this icon engine.

Returns
A new cloned QIconEngine instance.

◆ paint()

virtual void DeferredImageIconEngine::paint ( QPainter * painter,
const QRect & rect,
QIcon::Mode mode,
QIcon::State state )
overridevirtual

Paints the icon into the given rectangle using the specified painter.

Parameters
[in]painterThe QPainter to draw with.
[in]rectThe target rectangle.
[in]modeThe icon mode.
[in]stateThe icon state (On or Off).

◆ pixmap()

virtual QPixmap DeferredImageIconEngine::pixmap ( const QSize & size,
QIcon::Mode mode,
QIcon::State state )
overridevirtual

Returns a pixmap for the icon at the specified size, mode, and state.

Parameters
[in]sizeThe requested pixmap size.
[in]modeThe icon mode.
[in]stateThe icon state.
Returns
The rendered QPixmap.

◆ setIcon()

void DeferredImageIconEngine::setIcon ( const StringView & icon)

Changes the icon resource identifier.

Parameters
[in]iconThe new icon resource identifier.

◆ setIconTheme()

void DeferredImageIconEngine::setIconTheme ( const IconThemeSettings theme)

Sets the icon theme to use for rendering.

Parameters
[in]themeThe icon theme settings to apply.

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