#include <iconprovider.h>
◆ IconProvider()
albert::IconProvider::IconProvider |
( |
| ) |
|
◆ ~IconProvider()
albert::IconProvider::~IconProvider |
( |
| ) |
|
◆ clearCache()
void albert::IconProvider::clearCache |
( |
| ) |
|
Clears the internal icon cache.
◆ getPixmap() [1/2]
QPixmap albert::IconProvider::getPixmap |
( |
const QString & |
url, |
|
|
QSize * |
size, |
|
|
const QSize & |
requestedSize |
|
) |
| const |
Pixmap providing function.
- Parameters
-
size | Will get assigned the actual size of the pixmap created |
requestedSize | The size the pixmap should have if possible. |
url | The URL of the pixmap to be created. Supported url schemes:
<path> or file:<path> Use the file at path as icon.
:<path> or qrc:<path> Use the file at path in the resource collection as icon.
qfip:<path> Use QFileIconProvider to get a generic icon for the file at <path>.
qsp:<pixmap enumerator> Get an icon from QStyle::StandardPixmap enum.
xdg:<icon name> Performs freedesktop icon theme specification lookup (on supported platforms only) to get an icon.
gen:<> Generate an icon on the fly. Supports drawing a background circle and renders text on it. All parameters are optional. Available parameters are:
- background: The background color (default: none). See also QColor::fromString.
- foreground: (default: window text color from system palette)
- text: (default: none) The text to display
- fontscalar: (default: 1) Scalar for the default font size which is the pixmap height.
Examples /absolute/path/to/a/local/image/file.png
file:/absolute/path/to/a/local/image/file.png
:path-to-a-qresource-file
qrc:path-to-a-qresource-file
qfip:/path/to/any/file/for/example/a.pdf
qsp:SP_TrashIcon
xdg:some-themed-icon-name
gen:?background=blue&foreground=red&text=Hi&fontscalar=0.5
|
- Returns
- The pixmap, if available, null pixmap otherwise.
◆ getPixmap() [2/2]
QPixmap albert::IconProvider::getPixmap |
( |
const QStringList & |
urls, |
|
|
QSize * |
size, |
|
|
const QSize & |
requestedSize |
|
) |
| const |
The documentation for this class was generated from the following file: