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.
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:
boolsilhouetteEnabled() constvoidsetSilhouetteEnabled(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:
QColorsilhouetteBackground() constvoidsetSilhouetteBackground(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:
QColorsilhouetteForeground() constvoidsetSilhouetteForeground(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:
QStringsvgURL() constvoidsetSvgURL(constQString&url)