Extended Features
The Qt SVG module supports the static features of SVG 1.2 Tiny.
The module also supports a few extra features which might be useful. The QSvgRenderer parses all features (including the extra feature set) by default. You can instruct the render to ignore these extra features by passing the QtSvg::Tiny12FeaturesOnly flag in QSvgRenderer::setOptions().
Extended features
Qt supports the following extended elements and related attributes as of Qt 6.7:
- mask SVG 1.1
- symbol SVG 1.1 and SVG 2
- marker SVG 1.1
- pattern SVG 1.1
- filter SVG 1.1
- feColorMatrix SVG 1.1
- feComposite SVG 1.1
- feFlood SVG 1.1
- feGaussianBlur SVG 1.1
- feOffset SVG 1.1
- feMerge SVG 1.1
Masking
Masking is supported in the form of the <mask> element and the mask attribute.
Note: <clipPath> is not supported.
<mask>
The following attributes of the <mask> element are supported:
xywidthheightmaskUnitsmaskContentUnits
The mask attribute is supported for all graphical and structural SVG elements.
Symbols, Markers and Patterns
<symbol>
The following attributes of the <symbol> element are supported:
x(from SVG 2)y(from SVG 2)width(from SVG 2)height(from SVG 2)preserveAspectRatioviewBox
<marker>
The following attributes of the <marker> element are supported:
markerUnitsrefXrefYmarkerWidthmarkerHeightorientpreserveAspectRatioviewBox
The attributes
marker-startmarker-midmarker-end
are supported for <path>, <line>, <polyline> and <polygon>.
<pattern>
The following attributes are supported:
xywidthheightpatternUnitspatternContentUnitspatternTransformviewBox
The following attributes are not supported:
preserveAspectRatioxlink:href
Filter
Filters in SVG documents apply graphic effects on an element, parts of an element, or the background below the element. Qt supports filter effects applied to the whole element. Qt does not support applying filters on only the element's fill or stroke (FillPaint and StrokePaint), or its background (BackgroundImage and BackgroundAlpha).
<filter>
The following attributes of the <filter> element are supported:
xywidthheightfilterUnitsprimitiveUnits
The following attributes of the <filter> element are not supported:
filterResxlink:href
The filter attribute is supported for all graphical and structural SVG elements.
Filter primitives
The filter element contains various filter primitives. Qt supports the most important filter primitives (see below).
All filter primitives share common set of attributes. The following are supported:
xywidthheightin(Supported areSourceGraphic,SourceAlpha, and all references to filters)result
The following attributes are not supported:
in(Not supported areBackgroundImage,BackgroundAlpha,FillPaint, andStrokePaint)
<feColorMatrix>
The following attributes are supported:
typevalues
<feGaussianBlur>
The following attributes are supported:
stdDeviation
The following attributes are not supported:
edgeMode(the implementation matchesnone)
<feOffset>
The following attributes are supported:
dxdy
<feMerge> and <feMergeNode>
No additional attributes.
<feComposite>
The following attributes are supported:
operatork1k2k3k4
<feFlood>
The following attributes are supported:
flodd-colorflood-opacity