gui::IconCache Class Reference

Class caching loaded icons. More...

#include <iconcache.h>

List of all members.

Public Member Functions

 IconCache ()
 ~IconCache ()
QPixmap * getIcon (const QString &name)
QIcon * getIconSet (const QString &name)

Private Member Functions

QString getIconFile (const QString &name)

Detailed Description

Class caching loaded icons.

Class responsible for loading and caching icons
There can be multiple instances of this class at once, but all of them share common cache


Constructor & Destructor Documentation

gui::IconCache::IconCache (  ) 
gui::IconCache::~IconCache (  ) 

default destructor

References gui::iconCache, gui::iconCacheInstances, and gui::setCache.


Member Function Documentation

QPixmap * gui::IconCache::getIcon ( const QString &  name  ) 

Returns icon with given name, loading if necessary and caching for later use
Returns NULL if the icon cannot be loaded. Warning: Pixmap will be deleted when last instance of iconcache is deleted. If it is desired for application to hold the pixmap after iconcache is destroyed, it should make a copy

Parameters:
name Name of icon to get
Returns:
Pixmap containing specified icon

References debug::DBG_WARN, getIconFile(), guiPrintDbg, gui::iconCache, and Q_OUT.

Referenced by gui::AboutWindow::AboutWindow(), getIconSet(), and gui::MultiTreeWindow::MultiTreeWindow().

QString gui::IconCache::getIconFile ( const QString &  name  )  [private]

Given name of the icon, finds and returns full path to the icon, considering all relevant settings (icon path ..)

Parameters:
name Name of icon
Returns:
Full filename of the icon

References debug::DBG_WARN, guiPrintDbg, gui::iconPath, gui::iconStyleName, and Q_OUT.

Referenced by getIcon().

QIcon * gui::IconCache::getIconSet ( const QString &  name  ) 

Returns icon set with given name, creating from corresponding icon if necessary and caching for later use
Returns NULL if the icon in the icon set cannot be loaded.

Parameters:
name Name of icon set to get
Returns:
IconSet containing specified icon set

References getIcon(), QIcon, and gui::setCache.


The documentation for this class was generated from the following files: