Mantid
|
Defines a mapping between a workspace ID and a pixmap to use for an icon. More...
#include <WindowIcons.h>
Public Member Functions | |
QIcon | getIcon (const std::string &windowID) const |
Returns an icon for the given ID. More... | |
std::string | getIconID (const std::string &windowID) const |
Returns an icon ID for the given window ID. More... | |
WindowIcons () | |
Default constructor. More... | |
Private Member Functions | |
void | initInternalLookup () |
Defines the mapping between ID & pixmap name. More... | |
QIcon | makeIconFromFile (const std::string &path) const |
Build a icon object from an image file. More... | |
Private Attributes | |
QMap< std::string, std::string > | m_idToPixmapName |
Internal map instance. More... | |
Defines a mapping between a workspace ID and a pixmap to use for an icon.
Definition at line 19 of file WindowIcons.h.
MantidQt::API::WindowIcons::WindowIcons | ( | ) |
Default constructor.
Definition at line 22 of file WindowIcons.cpp.
References initInternalLookup().
QIcon MantidQt::API::WindowIcons::getIcon | ( | const std::string & | windowID | ) | const |
Returns an icon for the given ID.
windowID | A string giving the ID for a window |
std::runtime_error | if no icon can be found |
Definition at line 28 of file WindowIcons.cpp.
References MantidQt::API::getQPixmap(), m_idToPixmapName, makeIconFromFile(), and value.
std::string MantidQt::API::WindowIcons::getIconID | ( | const std::string & | windowID | ) | const |
Returns an icon ID for the given window ID.
Get the string ID representing the icon.
windowID | :: a string representing the ID of the window |
Definition at line 42 of file WindowIcons.cpp.
References m_idToPixmapName.
Referenced by MantidQt::MantidWidgets::ProjectSaveModel::makeWindowInfoObject().
|
private |
Defines the mapping between ID & pixmap name.
Initilise the internal lookup map.
Definition at line 56 of file WindowIcons.cpp.
References m_idToPixmapName.
Referenced by WindowIcons().
|
private |
Build a icon object from an image file.
Make a QIcon object froma file path.
This is used in the case that a pixmap does not exist and a file path to an image was provided instead.
path | :: path to the image to use to create the icon |
Definition at line 78 of file WindowIcons.cpp.
Referenced by getIcon().
|
private |
Internal map instance.
Definition at line 35 of file WindowIcons.h.
Referenced by getIcon(), getIconID(), and initInternalLookup().