Qt 6 replacement for ColorOverlay?
-
Is there a Qt 6 replacement for ColorOverlay?
I'm upgrading from Qt 5.15 to 6.1. Most of my images are SVG using the
ColorOverlay
fromQtGraphicalEffects
. I see that I can useQt5Compat.GraphicalEffects
, but I'm not clear if that is the long term solution or if there is some other way I should be doing color overlay on images in Qt 6.This app will only be in Qt 6, so I don't need backwards compatibility to 5.15.
Thanks!
-chris -
@christofer Side note...
I was getting console messages like this...
Texture 0x71f12c0f14440 () used with different accesses within the same pass, this is not allowed.
The messages stop if I cache each ColorOverlay. This isn't a problem, as far as I can tell, because none of my images are animated. But I don't know if it's expected.
Example that doesn't get the message...
Image { source: "/images/my-image.svg" width: 30 height: 30 ColorOverlay { color: "#99FF99" anchors.fill: parent source: parent cached: true } }
Example that does get the message...
Image { source: "/images/my-image.svg" width: 30 height: 30 ColorOverlay { color: "#99FF99" anchors.fill: parent source: parent //cached: true } }
-
@jeremy_k Thanks Jeremy! Making ColorOverlay a sibling works without having to cache.
I'm leaving the thread "unresolved" because my original question is about whether we should be using something other that qt5compat with Qt6 for the long run.
Example that works without cache...
Image { id: theImage source: "/images/my-image.svg" width: 30 height: 30 } ColorOverlay { color: "#99FF99" anchors.fill: theImage source: theImage }
update: Using
ColorOverlay
as sibling worked everywhere except in aRow
. The layout of theRow
got collapsed.cached: true
works for my particular case in theRow
but it still seems buggy. -
@christofer said in Qt 6 replacement for ColorOverlay?:
whether we should be using something other that qt5compat with Qt6 for the long run.
https://bugreports.qt.io/browse/QTBUG-85256
https://bugreports.qt.io/browse/QTBUG-78572ColorOverlay was ported so you can use the BSD licensed repo in Qt6
-
Based on the links @VRonin gave, it seems like we're supposed to still use ColorOverlay. But I'm leaving this thread unresolved because It still seems buggy or maybe I'm just not using it right.
I've been able to get all my SVG looking right without warnings using the tips above ... except for one that is animated.
-
Adding this bug report to the conversation: https://bugreports.qt.io/browse/QTBUG-88645
It appears GraphicalEffects is intended to be replaced by something like MultiEffect - which isn't ready for Qt 6 yet.
-