LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Provides scalable icons to QML. More...
#include "widthiconprovider.h"
Public Member Functions | |
WidthIconProvider () | |
QPixmap | requestPixmap (const QString &id, QSize *size, const QSize &requestedSize) |
Reimplemented from QDeclarativeImageProvider::requestPixmap(). More... | |
virtual QIcon | GetIcon (const QStringList &path)=0 |
Implement this method to return a proper QIcon for path. More... | |
Provides scalable icons to QML.
This class is used to provide pixmaps generated from QIcons to QML. It supports generating different pixmaps for different source sizes. For that, the last component of the URL in the source
property of a QML Image
should correspond to the current width, like this:
The subclasses should implement the GetIcon() pure virtual function, which should return a QIcon for a given path, where path is a QStringList obtained by breaking the URL path at '/' and leaving the width component.
Please also see the documentation for QIcon::pixmap()
regarding upscaling.
Definition at line 45 of file widthiconprovider.h.
LC::Util::WidthIconProvider::WidthIconProvider | ( | ) |
Definition at line 20 of file widthiconprovider.cpp.
|
pure virtual |
Implement this method to return a proper QIcon for path.
See this class documentation for more information.
[in] | path | The icon path, a list obtained by breaking the URL request path at '/'. |
Implemented in LC::Util::ThemeImageProvider, and LC::Util::SettableIconProvider.
QPixmap LC::Util::WidthIconProvider::requestPixmap | ( | const QString & | id, |
QSize * | size, | ||
const QSize & | requestedSize | ||
) |
Reimplemented from QDeclarativeImageProvider::requestPixmap().
[in] | id | The image ID. |
[in] | size | If non-null, will be set to the real size of the generated image. |
[in] | requestedSize | The requested image size. |
Definition at line 25 of file widthiconprovider.cpp.