![]() |
LeechCraft
0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
|
Provides icons from the current theme by their FDO name. More...
#include "themeimageprovider.h"
Public Member Functions | |
ThemeImageProvider (ICoreProxy_ptr proxy) | |
Creates the ThemeImageProvider with the given proxy. More... | |
QIcon | GetIcon (const QStringList &path) |
Returns an icon from the current iconset by its ID. More... | |
![]() | |
WidthIconProvider () | |
QPixmap | requestPixmap (const QString &id, QSize *size, const QSize &requestedSize) |
Reimplemented from QDeclarativeImageProvider::requestPixmap(). More... | |
Provides icons from the current theme by their FDO name.
This class is used to provide images from the current LeechCraft icon theme to QML.
Its usage is as simple as following. First, you should add it to a QDeclarativeEngine in C++, for example:
Here proxy is the plugin proxy passed to IInfo::Init() method of your plugin.
Then in QML:
Or if there is no need in scaling:
One could also use this with ActionButtons:
In this case there is no need to add width parameter manually, ActionButton will take care of it.
Definition at line 79 of file themeimageprovider.h.
LC::Util::ThemeImageProvider::ThemeImageProvider | ( | ICoreProxy_ptr | proxy | ) |
Creates the ThemeImageProvider with the given proxy.
[in] | proxy | The proxy object passed to IInfo::Init() of your plugin. |
Definition at line 38 of file themeimageprovider.cpp.
|
virtual |
Returns an icon from the current iconset by its ID.
Reimplemented from WidthIconProvider::GetIcon().
[in] | path | The icon path, like QStringList { "edit-delete" } . |
Implements LC::Util::WidthIconProvider.
Definition at line 43 of file themeimageprovider.cpp.