Table Of Contents

Previous topic

QIcon

Next topic

QGraphicsPixmapItem

QIconEngineV2

Inheritance diagram of QIconEngineV2

Synopsis

Functions

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

QIconEnginePluginV2

class PySide.QtGui.QIconEngineV2
PySide.QtGui.QIconEngineV2.IconEngineHook

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.virtual_hook()

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

PySide.QtGui.QIconEngineV2.clone()
Return type:PySide.QtGui.QIconEngineV2

Returns a clone of this icon engine.

PySide.QtGui.QIconEngineV2.iconName()
Return type:unicode

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

Note

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.

PySide.QtGui.QIconEngineV2.key()
Return type:unicode

Returns a key that identifies this icon engine.

PySide.QtGui.QIconEngineV2.read(in)
Parameters:inPySide.QtCore.QDataStream
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.

PySide.QtGui.QIconEngineV2.write(out)
Parameters:outPySide.QtCore.QDataStream
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.