taurus.qt.qtgui.icon
Utilities for using the bundled icons in Taurus and for registering external sources of icons.
Classes
- class QIconCatalog(parent=None)[source]
A widget that shows a tab for each registered search path prefix. In each tab, all icons available for the corresponding prefix are displayed. Clicking on an icon provides info on how to use it from a taurus application.
Functions
- getCachedPixmap(key, size=None)[source]
Returns a PyQt5.Qt.QPixmap object for the given key and size. The key argument supports QDir’s searchPath prefixes (see
QDir.setSearchPaths()
).
- getDevStateIcon(state, fallback=None)[source]
Gets a PyQt5.Qt.QIcon object for the given
taurus.core.taurusbasetypes.TaurusDevState
.If an icon cannot be found for the given state, fallback is returned.
- Parameters
state (TaurusDevState) – the taurus device state
fallback (PyQt5.Qt.QIcon) – the fallback icon. Default is None.
- Returns
- Return type
PyQt5.Qt.QIcon or None
- getDevStatePixmap(state, size=None)[source]
Gets a PyQt5.Qt.QPixmap object for the given
taurus.core.taurusbasetypes.TaurusDevState
.- Parameters
state (TaurusDevState) – the taurus software device state
size (int) – the pixmap size in pixels (will get a square pixmap). Default is None meaning it will return the original size.
- Returns
- Return type
PyQt5.Qt.QPixmap or None
- getElementTypeIcon(elemType, fallback=None)[source]
Gets a PyQt5.Qt.QIcon object for the given
taurus.core.taurusbasetypes.TaurusElementType
.If an icon cannot be found for the given TaurusElementType, fallback is returned.
- Parameters
elemType (TaurusElementType) – the taurus element type
fallback (PyQt5.Qt.QIcon) – the fallback icon. Default is None.
- Returns
- Return type
PyQt5.Qt.QIcon
- getElementTypeIconName(elemType)[source]
Gets an icon name string for the given
taurus.core.taurusbasetypes.TaurusElementType
.If an icon name cannot be found for elemType, None is returned.
- Parameters
elemType (TaurusElementType) – the taurus element type
- Returns
a string representing the icon name for the given
taurus.core.taurusbasetypes.TaurusElementType
- Return type
- getElementTypePixmap(elemType, size=None)[source]
Gets a PyQt5.Qt.QPixmap object for the given
taurus.core.taurusbasetypes.TaurusElementType
.- Parameters
elemType (TaurusElementType) – the taurus element type
size (int) – the pixmap size in pixels (will get a square pixmap). Default is None meaning it will return the original size.
- Returns
- Return type
PyQt5.Qt.QPixmap or None
- getStandardIcon(key, widget=None)[source]
Returns a PyQt5.Qt.QIcon object for the given key. Key should be a QStyle.StandardPixmap enumeration member. The widget argument is optional and can also be used to aid the determination of the icon.
- Parameters
key (QStyle.StandardPixmap) – a standard pixmap which can follow some existing GUI style or guideline
widget (Qt.QWidget) – the widget argument (optional) can also be used to aid the determination of the icon.
- Returns
- Return type
PyQt5.Qt.QIcon
- registerPathFiles(pathfilenames)[source]
Use given .path files to update Qt’s search path Each path file contains a json-encoded list of (prefix,path) tuples. This function will call Qt.QDir.addSearchPath with each of the tuples from the path files (prefix values will be sanitized first, and relative path values will be made relative to the dir containing the .path file)
- Parameters
pathfilenames (list<str>) – list of .path file names
- registerTheme(name='Tango', path='', force=False)[source]
Use bundled them if OS does not define a theme (non-X11 systems)
- sanitizePrefix(prefix)[source]
strips any leading ‘/’ and substitutes non alphanumeric characters by ‘_’
Variables
- REGISTERED_PREFIXES