Extended Features | Qt SVG | Qt 6.11.1
Description: Extended Features (relative to 1.2 Tiny) of the Qt SVG module

- Qt 6.11
- Qt SVG
- Extended Features
- Qt 6.11.1 Reference Documentation

Rendering SVG Files ◦ Upgrading from Qt 5

# 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:

- `x`
- `y`
- `width`
- `height`
- `maskUnits`
- `maskContentUnits`

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)
- `preserveAspectRatio`
- `viewBox`

### <marker>

The following attributes of the `<marker>` element are supported:

- `markerUnits`
- `refX`
- `refY`
- `markerWidth`
- `markerHeight`
- `orient`
- `preserveAspectRatio`
- `viewBox`

The attributes

- `marker-start`
- `marker-mid`
- `marker-end`

are supported for `<path>`, `<line>`, `<polyline>` and `<polygon>`.

### <pattern>

The following attributes are supported:

- `x`
- `y`
- `width`
- `height`
- `patternUnits`
- `patternContentUnits`
- `patternTransform`
- `viewBox`

The following attributes are not supported:

- `preserveAspectRatio`
- `xlink: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:

- `x`
- `y`
- `width`
- `height`
- `filterUnits`
- `primitiveUnits`

The following attributes of the `<filter>` element are not supported:

- `filterRes`
- `xlink: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:

- `x`
- `y`
- `width`
- `height`
- `in` (Supported are `SourceGraphic`, `SourceAlpha`, and all references to filters)
- `result`

The following attributes are not supported:

- `in` (Not supported are `BackgroundImage`, `BackgroundAlpha`, `FillPaint`, and `StrokePaint`)

### <feColorMatrix>

The following attributes are supported:

- `type`
- `values`

### <feGaussianBlur>

The following attributes are supported:

- `stdDeviation`

The following attributes are not supported:

- `edgeMode` (the implementation matches `none`)

### <feOffset>

The following attributes are supported:

- `dx`
- `dy`

### <feMerge> and <feMergeNode>

No additional attributes.

### <feComposite>

The following attributes are supported:

- `operator`
- `k1`
- `k2`
- `k3`
- `k4`

### <feFlood>

The following attributes are supported:

- `flodd-color`
- `flood-opacity`

Rendering SVG Files ◦ Upgrading from Qt 5