Hi everyone,
Is there any change on the Qt QML SVG filters(like feGaussianBlur) support from version 5.12 and up?
I need to use SVGs in a QML application. But the SVGs have a lot of filtering in them. In Inkscape, browsers and other software the SVGs are rendered correctly, but in Qt application they are not.
As I searched on internet, Qt QML has limited support for SVG filtering.
I even found that this was 'Out of scope' in Qt4:
https://bugreports.qt.io/browse/QTBUG-9081
I read this thread related to my question as well, but is from 2018:
https://www.qtcentre.org/threads/692...vg-in-examples
I have a simple Image that has an SVG file as source:
Image {
x: 0
y: 0
height: 120
width: 120
sourceSize.height: 120
sourceSize.width: 120
source: "qrc:/images/example.svg"
}
Image {
x: 0
y: 0
height: 120
width: 120
sourceSize.height: 120
sourceSize.width: 120
source: "qrc:/images/example.svg"
}
To copy to clipboard, switch view to plain text mode
And the SVG code looks like this:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="120" height="120" viewBox="0 0 120 120">
<defs>
<style type="text/css">
.p {
filter: url(#e);
}
</style>
<filter id="e" x="0" y="0" width="83" height="83" filterUnits="userSpaceOnUse">
<feOffset dx="8" dy="8" input="SourceAlpha" />
<feGaussianBlur stdDeviation="5.0" result="f" />
<feComposite operator="in" in2="f" />
<feComposite in="SourceGraphic" />
</filter>
</defs>
<g transform="translate(10.5 10.5)">
<g class="p" transform="matrix(1, 0, 0, 1, -10.5, -10.5)">
<circle class="a" cx="28" cy="28" r="28" transform="translate(10.5 10.5)" />
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="120" height="120" viewBox="0 0 120 120">
<defs>
<style type="text/css">
.p {
filter: url(#e);
}
</style>
<filter id="e" x="0" y="0" width="83" height="83" filterUnits="userSpaceOnUse">
<feOffset dx="8" dy="8" input="SourceAlpha" />
<feGaussianBlur stdDeviation="5.0" result="f" />
<feComposite operator="in" in2="f" />
<feComposite in="SourceGraphic" />
</filter>
</defs>
<g transform="translate(10.5 10.5)">
<g class="p" transform="matrix(1, 0, 0, 1, -10.5, -10.5)">
<circle class="a" cx="28" cy="28" r="28" transform="translate(10.5 10.5)" />
</g>
</g>
</svg>
To copy to clipboard, switch view to plain text mode
Any news about the SVG filtering support?
Or am I missing something?
Is there any other approach?
Bookmarks