Class caching loaded icons. More...
#include <iconcache.h>
Public Member Functions | |
| IconCache () | |
| ~IconCache () | |
| QPixmap * | getIcon (const QString &name) |
| QIcon * | getIconSet (const QString &name) |
Private Member Functions | |
| QString | getIconFile (const QString &name) |
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
| gui::IconCache::IconCache | ( | ) |
Default constructor of IconCache
References gui::globalSettings, gui::iconCacheInstances, gui::iconPath, gui::iconStyleName, gui::Settings::read(), and gui::Settings::readPath().
| gui::IconCache::~IconCache | ( | ) |
default destructor
References gui::iconCache, gui::iconCacheInstances, and gui::setCache.
| 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
| name | Name of icon to get |
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 ..)
| name | Name of 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.
| name | Name of icon set to get |
References getIcon(), QIcon, and gui::setCache.