Qt 6.8 - VectorImage and color/colorization issues (with MultiEffect)
-
EDIT: Solved - in thread comment #2
Original Post: So using Qt6.8, I've replaced my IconImage usage with VectorImage since I use many small SVG files in my application. I've thus become unable to use "color" since VectorImage doesn't support/extend this.
I've since begun using MultiEffect, but WITH issues (screenshot further down)
Code for minimal:
Item { id: root color: <input from higher level> source: <input from higher> VectorImage { id: mySVG width: root.desired_width source: root.source anchors.centerIn: parent preferredRendererType: VectorImage.CurveRenderer fillMode: Image.PreserveAspectFit } MultiEffect { id: colorOverlay source: mySVG anchors.fill: mySVG colorization: 1.0 // opacity equivalent colorizationColor: root.color } }
Here's the issue: I get a tiny WHITE line around the outside of my "non-white" implementations of this Item
How can I go about improving this? Anyone had luck with the new VectorImage and color?
-
SOLVED thanks to a previous forum post regarding using MultiEffect on
Image{}
type componentAll that's required is to set VectorImage's
visible
to false, since the compositor seems to be double rendering, I suppose, creating the unwanted outline of the SVGThanks to 6.5 article: https://forum.qt.io/topic/144070/qt6-color-svg-using-multieffect/3
and member: https://forum.qt.io/user/mzimmersNew graphics:
WORKING CODE:
Item { id: root color: <input from higher level> source: <input from higher> VectorImage { id: mySVG ~~~~ same lines from above ~~~~~ visible: false <======== DONT FORGET THIS } MultiEffect { id: colorOverlay source: mySVG anchors.fill: mySVG colorization: 1.0 // opacity equivalent colorizationColor: root.color } }
-