devctrl.resources.icon.load_icon#
- load_icon(icon_name: str, dark_mode: bool | None = None, fallback: str | None = None, raise_if_no_icon=False) QIcon[source]#
Load an application icon.
When
dark_modeisNone(the default), the returned QIcon is dynamically theme-aware.Example:
button.setIcon(load_icon(“search”))
The same QIcon can subsequently render:
icons/search.svgoricons-dark/search.svgdepending on the current Qt color scheme (the actual directories of the icon depend on the configured search paths).If
dark_modeis explicitly True or False, a normal static QIcon is returned for that specific theme. This is useful for callers that deliberately want to override automatic theme selection.