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
QThemeIconEngine Class Reference

A named-based icon engine for providing theme icons. More...

#include <qiconloader_p.h>

Inheritance diagram for QThemeIconEngine:
Collaboration diagram for QThemeIconEngine:

Public Member Functions

 QThemeIconEngine (const QString &iconName=QString())
QIconEngineclone () const override
 Reimplement this method to return a clone of this icon engine.
bool read (QDataStream &in) override
 Reads icon engine contents from the QDataStream in.
bool write (QDataStream &out) const override
 Writes the contents of this engine to the QDataStream out.
Public Member Functions inherited from QProxyIconEngine
void paint (QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override
 Uses the given painter to paint the icon with the required mode and state into the rectangle rect.
QSize actualSize (const QSize &size, QIcon::Mode mode, QIcon::State state) override
 Returns the actual size of the icon the engine provides for the requested size, mode and state.
QPixmap pixmap (const QSize &size, QIcon::Mode mode, QIcon::State state) override
 Returns the icon as a pixmap with the required size, mode, and state.
void addPixmap (const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) override
 Called by QIcon::addPixmap().
void addFile (const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) override
 Called by QIcon::addFile().
QList< QSizeavailableSizes (QIcon::Mode mode=QIcon::Normal, QIcon::State state=QIcon::Off) override
 Returns sizes of all images that are contained in the engine for the specific mode and state.
QString iconName () override
 Returns the name used to create the engine, if available.
bool isNull () override
QPixmap scaledPixmap (const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale) override
void virtual_hook (int id, void *data) override
 Additional method to allow extending QIconEngine without adding new virtual methods (and without breaking binary compatibility).
Public Member Functions inherited from QIconEngine
 QIconEngine ()
virtual ~QIconEngine ()
 Destroys the icon engine.

Protected Member Functions

QIconEngineproxiedEngine () const override
Protected Member Functions inherited from QIconEngine
 QIconEngine (const QIconEngine &other)

Private Member Functions

QString key () const override
 \variable QIconEngine::ScaledPixmapArgument::size

Additional Inherited Members

Public Types inherited from QIconEngine
enum  IconEngineHook { IsNullHook = 3 , ScaledPixmapHook }
 These enum values are used for virtual_hook() to allow additional queries to icon engine without breaking binary compatibility. More...

Detailed Description

A named-based icon engine for providing theme icons.

\inmodule QtGui

The engine supports invalidation of prior lookups, e.g. when the platform theme changes or the user sets an explicit icon theme.

The actual icon lookup is handed over to an engine provided by QIconLoader::iconEngine().

Definition at line 93 of file qiconloader_p.h.

Constructor & Destructor Documentation

◆ QThemeIconEngine()

QThemeIconEngine::QThemeIconEngine ( const QString & iconName = QString())

Definition at line 719 of file qiconloader.cpp.

Member Function Documentation

◆ clone()

QIconEngine * QThemeIconEngine::clone ( ) const
overridevirtual

Reimplement this method to return a clone of this icon engine.

Reimplemented from QProxyIconEngine.

Definition at line 739 of file qiconloader.cpp.

◆ key()

QString QThemeIconEngine::key ( ) const
overrideprivatevirtual

\variable QIconEngine::ScaledPixmapArgument::size

The requested size of the pixmap.

\variable QIconEngine::ScaledPixmapArgument::mode

The requested mode of the pixmap.

See also
QIcon::Mode

\variable QIconEngine::ScaledPixmapArgument::state

The requested state of the pixmap.

See also
QIcon::State

\variable QIconEngine::ScaledPixmapArgument::scale

The requested scale of the pixmap.

\variable QIconEngine::ScaledPixmapArgument::pixmap

The pixmap that is the best match for the given \l size, \l mode, \l state, and \l scale. This is an output parameter that is set after calling \l virtual_hook().

Returns a key that identifies this icon engine.

Reimplemented from QProxyIconEngine.

Definition at line 731 of file qiconloader.cpp.

◆ proxiedEngine()

QIconEngine * QThemeIconEngine::proxiedEngine ( ) const
overrideprotectedvirtual

Implements QProxyIconEngine.

Definition at line 755 of file qiconloader.cpp.

◆ read()

bool QThemeIconEngine::read ( QDataStream & in)
overridevirtual

Reads icon engine contents from the QDataStream in.

Returns true if the contents were read; otherwise returns false.

QIconEngine's default implementation always return false.

Reimplemented from QProxyIconEngine.

Definition at line 744 of file qiconloader.cpp.

◆ write()

bool QThemeIconEngine::write ( QDataStream & out) const
overridevirtual

Writes the contents of this engine to the QDataStream out.

Returns true if the contents were written; otherwise returns false.

QIconEngine's default implementation always return false.

Reimplemented from QProxyIconEngine.

Definition at line 749 of file qiconloader.cpp.


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