|
|
Icon loader with caching.
Multiple loads of the same icon using this class will be cached using QPixmapCache, saving memory and loading time.
Within KDE there are two distinct groups of Icons:
Icons are searched for according to the KDE file system standard using KStandardDirs. Look up the various methods for details how.
All keys used in QPixmapCache by this class have the "$kico_.." prefix.
enum |
Specifies the size of the requested icon:
|
Constructor. Adds some application specific paths to lookup
toolbar icons. These are below the application's data dir
(@see KStandardDirs for details) and are namely pics
/ and
toolbar
/
Parameters:
app_name | specifies the name of the application to add paths of. If the name is null (default) the name from KGlobal::instance() is used. |
|
Constructs an KIconLoader for a component stored in a shared library. Objects constructed with this constructor access all instance related data (search paths, application name) from the given library instead of KGlobal::instance().
QPixmap |
Load an icon from disk without cache.
This is useful if the icon has changed on the filesystem and you want to be sure that you get the new version, not the old one from the cache. The returned pixmap will be inserted in the cache so you use loadIcon after that.
QPixmap |
This method should be used for loading most non-toolbar icons (it @bf will load toolbar icons, but the recommended way is to use BarIcon).
Parameters:
name | Icon name without extension. An example is @p "konqueror" or @p "mimetypes/postscript" |
size | The prefered size to load. |
path_store | This output parameter will contain the full path to the icon if not 0. |
canReturnNull | If this is false , this function will return
the "unknown" icon if the requested icon is not found.
The default is to return null .
|
QString |
Get the complete path for a toolbar icon name.
Parameters:
name | The name of the icon to search for. |
always_valid | If true, the function will return the path to "unknown" if the icon is not found. Note that it will return null if "unknown" was also not found. |
Returns: The physical path to the named icon.
QStringList |
[const]
This will return a list of all icon directories that match the given parameters. With the default params, this will return all KDE recognized icon directories that currently exist. By changing the params, you can narrow this down to specifics.
For instance:
iconDirs("all", "hicolor", "large");
Will return all directories that have large hicolor icons.
Parameters:
type | The icon type (apps, devices, filesystems, mimetypes, toolbars, or all) |
depth | The color depth (hicolor, locolor, or all) |
size | The icon size (large, medium, small, or all) |
trim | If true, then only existing directories will be returned |
Returns: A list of all icon directories that match the params
QPixmap |
[protected]
honourcache will check if the icon is contained in the cache before trying to load it. Used by loadIcon and reloadIcon (with different honourcache parameter)