Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::API::WorkspaceIcons Class Reference

Defines a mapping between a workspace ID and a pixmap to use for an icon. More...

#include <WorkspaceIcons.h>

Public Member Functions

QPixmap getIcon (const std::string &workspaceID) const
 Returns an icon for the given ID. More...
 
std::string getIconID (const std::string &workspaceID) const
 Returns an icon ID for the given workspace ID. More...
 
 WorkspaceIcons ()
 Default constructor. More...
 

Private Member Functions

void initInternalLookup ()
 Defines the mapping between ID & pixmap name. More...
 

Private Attributes

QMap< std::string, std::string > m_idToPixmapName
 Internal map instance. More...
 

Detailed Description

Defines a mapping between a workspace ID and a pixmap to use for an icon.

Definition at line 19 of file WorkspaceIcons.h.

Constructor & Destructor Documentation

◆ WorkspaceIcons()

MantidQt::API::WorkspaceIcons::WorkspaceIcons ( )

Default constructor.

Definition at line 20 of file WorkspaceIcons.cpp.

References initInternalLookup().

Member Function Documentation

◆ getIcon()

QPixmap MantidQt::API::WorkspaceIcons::getIcon ( const std::string &  workspaceID) const

Returns an icon for the given ID.

Parameters
workspaceIDA string giving the ID for a workspace
Exceptions
std::runtime_errorif no icon can be found

Definition at line 26 of file WorkspaceIcons.cpp.

References MantidQt::API::getQPixmap(), and m_idToPixmapName.

◆ getIconID()

std::string MantidQt::API::WorkspaceIcons::getIconID ( const std::string &  workspaceID) const

Returns an icon ID for the given workspace ID.

Get the string ID representing the icon.

Parameters
workspaceID:: a string representing the ID of the workspace
Returns
a string with the QPixmap id for this workspace.

Definition at line 40 of file WorkspaceIcons.cpp.

References m_idToPixmapName.

Referenced by MantidQt::MantidWidgets::ProjectSaveModel::makeWorkspaceInfoObject().

◆ initInternalLookup()

void MantidQt::API::WorkspaceIcons::initInternalLookup ( )
private

Defines the mapping between ID & pixmap name.

Definition at line 51 of file WorkspaceIcons.cpp.

References m_idToPixmapName.

Referenced by WorkspaceIcons().

Member Data Documentation

◆ m_idToPixmapName

QMap<std::string, std::string> MantidQt::API::WorkspaceIcons::m_idToPixmapName
private

Internal map instance.

Definition at line 33 of file WorkspaceIcons.h.

Referenced by getIcon(), getIconID(), and initInternalLookup().


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