edifice.Icon#

class edifice.Icon(name, size=10, collection='font-awesome', sub_collection='solid', color=(0, 0, 0, 255), rotation=0, **kwargs)[source]#

Bases: QtWidgetElement[QLabel]

Display an Icon.

Props

All props from QtWidgetElement plus:

Parameters:
  • name (str) – name of the icon. Search for the name on https://fontawesome.com/icons?d=gallery&s=regular,solid

  • size (int) – size of the icon.

  • collection (str) – the icon package. Currently only font-awesome is supported.

  • sub_collection (str) – for font awesome, either solid or regular

  • color (Tuple[int, int, int, int]) – the RGBA value for the icon color

  • rotation (float) – an angle (in degrees) for the icon rotation

Usage

../_images/icons.png

Two icons#

Icons are central to modern-looking UI design. Edifice comes with the Font Awesome (https://fontawesome.com) regular and solid icon sets, to save you time from looking up your own icon set. You can specify an icon simplify using its name (and optionally the sub_collection).

Example classic share icon#
Icon(name="share")

You can browse and search for icons here: https://fontawesome.com/icons?d=gallery&s=regular,solid

For full control of custom icons, use an ImageSvg instead.

Methods

__init__(name[, size, collection, ...])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Set the key of an Element.

Attributes

children

The children of this Element.

props

The props of this Element.

underlying

The underlying QWidget, which may not exist if this Element has not rendered.