
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQIconEngine class provides an abstract base class forQIcon renderers.More...
| Header: | #include <QIconEngine> |
| Inherited By: |
| virtual | ~QIconEngine() |
| virtual QSize | actualSize(const QSize & size, QIcon::Mode mode, QIcon::State state) |
| virtual void | addFile(const QString & fileName, const QSize & size, QIcon::Mode mode, QIcon::State state) |
| virtual void | addPixmap(const QPixmap & pixmap, QIcon::Mode mode, QIcon::State state) |
| virtual void | paint(QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state) = 0 |
| virtual QPixmap | pixmap(const QSize & size, QIcon::Mode mode, QIcon::State state) |
TheQIconEngine class provides an abstract base class forQIcon renderers.
UseQIconEngineV2 instead.
An icon engine provides the rendering functions for aQIcon. Each icon has a corresponding icon engine that is responsible for drawing the icon with a requested size, mode and state.
The icon is rendered by thepaint() function, and the icon can additionally be obtained as a pixmap with thepixmap() function (the default implementation simply usespaint() to achieve this). TheaddPixmap() function can be used to add new pixmaps to the icon engine, and is used byQIcon to add specialized custom pixmaps.
Thepaint(),pixmap(), andaddPixmap() functions are all virtual, and can therefore be reimplemented in subclasses ofQIconEngine.
See alsoQIconEngineV2 andQIconEnginePlugin.
[virtual]QIconEngine::~QIconEngine()Destroys the icon engine.
[virtual]QSize QIconEngine::actualSize(constQSize & size,QIcon::Mode mode,QIcon::State state)Returns the actual size of the icon the engine provides for the requestedsize,mode andstate. The default implementation returns the givensize.
[virtual]void QIconEngine::addFile(constQString & fileName, constQSize & size,QIcon::Mode mode,QIcon::State state)Called byQIcon::addFile(). Adds a specialized pixmap from the file with the givenfileName,size,mode andstate. The default pixmap-based engine stores any supplied file names, and it loads the pixmaps on demand instead of using scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra files.
[virtual]void QIconEngine::addPixmap(constQPixmap & pixmap,QIcon::Mode mode,QIcon::State state)Called byQIcon::addPixmap(). Adds a specializedpixmap for the givenmode andstate. The default pixmap-based engine stores any supplied pixmaps, and it uses them instead of scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra pixmaps.
[pure virtual]void QIconEngine::paint(QPainter * painter, constQRect & rect,QIcon::Mode mode,QIcon::State state)Uses the givenpainter to paint the icon with the requiredmode andstate into the rectanglerect.
[virtual]QPixmap QIconEngine::pixmap(constQSize & size,QIcon::Mode mode,QIcon::State state)Returns the icon as a pixmap with the requiredsize,mode, andstate. The default implementation creates a new pixmap and callspaint() to fill it.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.