Qt 4.8
|
The QIconEngineV2 class provides an abstract base class for QIcon renderers. More...
#include <qiconengine.h>
Classes | |
class | AvailableSizesArgument |
This struct represents arguments to virtual_hook() function when id parameter is QIconEngineV2::AvailableSizesHook. More... | |
Public Types | |
enum | IconEngineHook { AvailableSizesHook = 1, IconNameHook } |
These enum values are used for virtual_hook() to allow additional queries to icon engine without breaking binary compatibility. More... | |
Public Functions | |
QList< QSize > | availableSizes (QIcon::Mode mode=QIcon::Normal, QIcon::State state=QIcon::Off) |
Returns sizes of all images that are contained in the engine for the specific mode and state. More... | |
virtual QIconEngineV2 * | clone () const |
Returns a clone of this icon engine. More... | |
QString | iconName () |
Returns the name used to create the engine, if available. More... | |
virtual QString | key () const |
Returns a key that identifies this icon engine. More... | |
virtual bool | read (QDataStream &in) |
Reads icon engine contents from the QDataStream in. More... | |
virtual void | virtual_hook (int id, void *data) |
Additional method to allow extending QIconEngineV2 without adding new virtual methods (and without breaking binary compatibility). More... | |
virtual bool | write (QDataStream &out) const |
Writes the contents of this engine to the QDataStream out. More... | |
Public Functions inherited from QIconEngine | |
virtual QSize | actualSize (const QSize &size, QIcon::Mode mode, QIcon::State state) |
Returns the actual size of the icon the engine provides for the requested size, mode and state. More... | |
virtual void | addFile (const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) |
Called by QIcon::addFile(). More... | |
virtual void | addPixmap (const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) |
Called by QIcon::addPixmap(). More... | |
virtual void | paint (QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state)=0 |
Uses the given painter to paint the icon with the required mode and state into the rectangle rect. More... | |
virtual QPixmap | pixmap (const QSize &size, QIcon::Mode mode, QIcon::State state) |
Returns the icon as a pixmap with the required size, mode, and state. More... | |
virtual | ~QIconEngine () |
Destroys the icon engine. More... | |
The QIconEngineV2 class provides an abstract base class for QIcon renderers.
An icon engine renders QIcon. 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 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 QIconEngineV2 class description to learn how to create icon engine plugins.
An icon engine provides the rendering functions for a QIcon. Each icon has a corresponding icon engine that is responsible for drawing the icon with a requested size, mode and state.
QIconEngineV2 extends the API of QIconEngine to allow streaming of the icon engine contents, and should be used instead of QIconEngine for implementing new icon engines.
Definition at line 73 of file qiconengine.h.
These enum values are used for virtual_hook() to allow additional queries to icon engine without breaking binary compatibility.
Enumerator | |
---|---|
AvailableSizesHook | |
IconNameHook |
Definition at line 83 of file qiconengine.h.
QList< QSize > QIconEngineV2::availableSizes | ( | QIcon::Mode | mode = QIcon::Normal , |
QIcon::State | state = QIcon::Off |
||
) |
Returns sizes of all images that are contained in the engine for the specific mode and state.
Definition at line 326 of file qiconengine.cpp.
|
virtual |
Returns a clone of this icon engine.
Reimplemented in QPixmapIconEngine, QIconLoaderEngine, and QSvgIconEngine.
Definition at line 259 of file qiconengine.cpp.
Referenced by QIcon::detach().
QString QIconEngineV2::iconName | ( | ) |
Returns the name used to create the engine, if available.
Definition at line 347 of file qiconengine.cpp.
Referenced by QIcon::name().
|
virtual |
Returns a key that identifies this icon engine.
Reimplemented in QIconLoaderEngine, QPixmapIconEngine, and QSvgIconEngine.
Definition at line 251 of file qiconengine.cpp.
Referenced by operator<<().
|
virtual |
Reads icon engine contents from the QDataStream in.
Returns true if the contents were read; otherwise returns false.
QIconEngineV2's default implementation always return false.
Reimplemented in QPixmapIconEngine, QIconLoaderEngine, and QSvgIconEngine.
Definition at line 270 of file qiconengine.cpp.
Referenced by operator>>().
|
virtual |
Additional method to allow extending QIconEngineV2 without adding new virtual methods (and without breaking binary compatibility).
The actual action and format of data depends on id argument which is in fact a constant from IconEngineHook enum.
Reimplemented in QIconLoaderEngine, and QPixmapIconEngine.
Definition at line 299 of file qiconengine.cpp.
Referenced by QPixmapIconEngine::virtual_hook(), and QIconLoaderEngine::virtual_hook().
|
virtual |
Writes the contents of this engine to the QDataStream out.
Returns true if the contents were written; otherwise returns false.
QIconEngineV2's default implementation always return false.
Reimplemented in QPixmapIconEngine, QIconLoaderEngine, and QSvgIconEngine.
Definition at line 281 of file qiconengine.cpp.
Referenced by operator<<().