LeechCraft
0.6.70-15082-g543737046d
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 (const ICoreProxy_ptr &proxy) | |
Creates the ThemeImageProvider with the given proxy. More... | |
QIcon | GetIcon (const QStringList &path) override |
Returns an icon from the current iconset by its ID. More... | |
Public Member Functions inherited from LC::Util::WidthIconProvider | |
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 62 of file themeimageprovider.h.
LC::Util::ThemeImageProvider::ThemeImageProvider | ( | const 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 21 of file themeimageprovider.cpp.
|
overridevirtual |
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 26 of file themeimageprovider.cpp.