Public Member Functions | Private Attributes | List of all members
rqt_robot_dashboard.util.IconHelper Class Reference
Inheritance diagram for rqt_robot_dashboard.util.IconHelper:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, paths=None, name="IconHelper")
 
def add_image_path (self, path)
 
def build_icon (self, image_name_list, mode=QIcon.Normal, state=QIcon.On)
 
def find_image (self, path)
 
def make_icon (self, image_list, mode=QIcon.Normal, state=QIcon.On)
 
def set_icon_lists (self, icons, clicked_icons=None, suppress_overlays=False)
 

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 105 of file util.py.

Constructor & Destructor Documentation

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

Definition at line 109 of file util.py.

Member Function Documentation

def rqt_robot_dashboard.util.IconHelper.add_image_path (   self,
  path 
)
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 113 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 193 of file util.py.

def rqt_robot_dashboard.util.IconHelper.find_image (   self,
  path 
)
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 176 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 125 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 209 of file util.py.

Member Data Documentation

rqt_robot_dashboard.util.IconHelper._image_paths
private

Definition at line 110 of file util.py.

rqt_robot_dashboard.util.IconHelper._name
private

Definition at line 111 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 Fri May 15 2020 03:39:04