Public Member Functions | Private Attributes
rqt_robot_dashboard.util.IconHelper Class Reference

List of all members.

Public Member Functions

def __init__
def add_image_path
def build_icon
def find_image
def make_icon
def set_icon_lists

Private Attributes

 _image_paths
 _name

Detailed Description

Helper class to easily access images and build QIcons out of lists of file names

Definition at line 104 of file util.py.


Constructor & Destructor Documentation

def rqt_robot_dashboard.util.IconHelper.__init__ (   self,
  paths = None,
  name = "IconHelper" 
)

Definition at line 108 of file util.py.


Member Function Documentation

Paths added will be searched for images by the _find_image function
Paths will be searched in revearse order by add time
The last path to be searched is always rqt_robot_dashboard/images
Subdirectories are not recursively searched

:param path: The path to add to the image paths list
:type path: str

Definition at line 112 of file util.py.

def rqt_robot_dashboard.util.IconHelper.build_icon (   self,
  image_name_list,
  mode = QIcon.Normal,
  state = QIcon.On 
)
Convenience function to create an icon from a list of file names

:param image_name_list: List of file image names to make into an icon
:type image_name_list: list of str
:param mode: The mode of the QIcon to be created.
:type mode: int
:param state: the state of the QIcon to be created.
:type state: int

Definition at line 192 of file util.py.

Convenience function to help with finding images.
Path can either be specified as absolute paths or relative to any path in ``_image_paths``

:param path: The path or name of the image.
:type path: str

Definition at line 175 of file util.py.

def rqt_robot_dashboard.util.IconHelper.make_icon (   self,
  image_list,
  mode = QIcon.Normal,
  state = QIcon.On 
)
Helper function to create QIcons from lists of image files
Warning: svg files interleaved with other files will not render correctly

:param image_list: list of image paths to layer into an icon.
:type image: list of str
:param mode: The mode of the QIcon to be created.
:type mode: int
:param state: the state of the QIcon to be created.
:type state: int

Definition at line 124 of file util.py.

def rqt_robot_dashboard.util.IconHelper.set_icon_lists (   self,
  icons,
  clicked_icons = None,
  suppress_overlays = False 
)
Sets up the icon lists for the button states.
There must be one index in icons for each state.

:raises IndexError: if ``icons`` is not a list of lists of strings

:param icons: A list of lists of strings to create icons for the states of this button.\
If only one is supplied then ok, warn, error, stale icons will be created with overlays
:type icons: list
:param clicked_icons: A list of clicked state icons. len must equal icons
:type clicked_icons: list
:param suppress_overlays: if false and there is only one icon path supplied
:type suppress_overlays: bool

Definition at line 208 of file util.py.


Member Data Documentation

Definition at line 108 of file util.py.

Definition at line 108 of file util.py.


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


rqt_robot_dashboard
Author(s): Ze'ev Klapow
autogenerated on Mon Oct 6 2014 07:16:16