Table Of Contents

Previous topic


Next topic



Inheritance diagram of QIconEngineV2



Virtual functions

Detailed Description

The PySide.QtGui.QIconEngineV2 class provides an abstract base class for PySide.QtGui.QIcon renderers.

An icon engine renders PySide.QtGui.QIcon s. With icon engines, you can customize icons. Qt provides a default engine that makes icons adhere to the current style by scaling the icons and providing a disabled appearance.

An engine is installed on an icon either through a PySide.QtGui.QIcon constructor or through a QIconEnginePluginV2 . The plugins are used by Qt if a specific engine is not given when the icon is created. See the PySide.QtGui.QIconEngineV2 class description to learn how to create icon engine plugins.

An icon engine provides the rendering functions for a PySide.QtGui.QIcon . Each icon has a corresponding icon engine that is responsible for drawing the icon with a requested size, mode and state.

PySide.QtGui.QIconEngineV2 extends the API of PySide.QtGui.QIconEngine to allow streaming of the icon engine contents, and should be used instead of PySide.QtGui.QIconEngine for implementing new icon engines.

See also


class PySide.QtGui.QIconEngineV2

These enum values are used for PySide.QtGui.QIconEngineV2.virtual_hook() to allow additional queries to icon engine without breaking binary compatibility.

Constant Description
QIconEngineV2.AvailableSizesHook Allows to query the sizes of the contained pixmaps for pixmap-based engines. The data argument of the PySide.QtGui.QIconEngineV2.virtual_hook() function is a AvailableSizesArgument pointer that should be filled with icon sizes. Engines that work in terms of a scalable, vectorial format normally return an empty list.
QIconEngineV2.IconNameHook Allows to query the name used to create the icon, for example when instantiating an icon using QIcon.fromTheme() .

See also


PySide.QtGui.QIconEngineV2.availableSizes([mode=QIcon.Normal[, state=QIcon.Off]])
Return type:

Return type:PySide.QtGui.QIconEngineV2

Returns a clone of this icon engine.

Return type:unicode

Returns the name used to create the engine, if available.


This is a helper method and the actual work is done by PySide.QtGui.QIconEngineV2.virtual_hook() method, hence this method depends on icon engine support and may not work with all icon engines.

Return type:unicode

Returns a key that identifies this icon engine.
Return type:PySide.QtCore.bool

Reads icon engine contents from the PySide.QtCore.QDataStream in . Returns true if the contents were read; otherwise returns false.

PySide.QtGui.QIconEngineV2 ‘s default implementation always return false.

Return type:PySide.QtCore.bool

Writes the contents of this engine to the PySide.QtCore.QDataStream out . Returns true if the contents were written; otherwise returns false.

PySide.QtGui.QIconEngineV2 ‘s default implementation always return false.