SvgWidget

Widget for rendering SVG graphics with silhouette effects.

Declared in src/libs/libwidgets/components/SvgWidget.hpp
Inherits QWidget
Inherited By IdenticonWidget, SentientIdenticonWidget, SentientVerificationStatusWidget, TrustIconWidget, and TrustSymbolWidget
Group widgets

Detailed description

SvgWidget displays SVG images with optional silhouette rendering that can colorize the foreground and background independently.

SvgWidget

See also QSvgRenderer.

Property documentation

silhouette property

silhouette : bool

This property holds whether the widget paints the image as a one-color silhouette.

When it is on, every visible pixel of the image takes the silhouetteForeground color, and the widget fills its area with the silhouetteBackground color first. The default is off.

Before configure() runs, a write does nothing and a read returns false.

Access functions:

  • bool silhouetteEnabled() const
  • void setSilhouetteEnabled(bool)

silhouetteBackground property

silhouetteBackground : QColor

This property holds the color behind the image when the silhouette is on.

The default is transparent, and a transparent background paints nothing. Before configure() runs, a write does nothing and a read returns an invalid color.

Access functions:

  • QColor silhouetteBackground() const
  • void setSilhouetteBackground(QColor)

silhouetteForeground property

silhouetteForeground : QColor

This property holds the color of the image when the silhouette is on.

The default is white. Before configure() runs, a write does nothing and a read returns an invalid color.

Access functions:

  • QColor silhouetteForeground() const
  • void setSilhouetteForeground(QColor)

svgURL property

svgURL : QString

This property holds the path or URL of the SVG image that the widget shows.

A write loads the image into a new renderer and marks the widget for a new render. The widget scales the image to fit and keeps its aspect ratio. A read returns the last value written, and an empty string after setSvg() supplied the image as an object. The default is empty, and with no image the widget paints red.

Access functions:

  • QString svgURL() const
  • void setSvgURL(const QString &url)
In this section