edifice.ImageSvg#

class edifice.ImageSvg(src, **kwargs)[source]#

Bases: QtWidgetElement[QSvgWidget]

Render an SVG image.

Props

All props from QtWidgetElement, plus:

Parameters:

src (str | QByteArray) – Either a path to an SVG image file, or a QByteArray containing the XML string of an SVG file.

Usage

henomaru = QByteArray.fromStdString(
    '<svg viewBox="0 0 200 200"><circle fill="red" cx="100" cy="100" r="100"/></svg>'
)

ImageSvg(
    src=henomaru,
    style={"width": 100, "height": 100},
)

Methods

__init__(src, **kwargs)

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.