I'm quite new to the Qt world, but can't find a solution for this problem. I've have a view using a repeater of Image + ColorOverlay. Rendering is quite slow, here is what I actually use :
Column {
Repeater {
model: 100
Rectangle {
width: 16; height: 16;
color: "transparent"
ColorOverlay {
anchors.fill: parent
source:
Image {
fillMode: Image.PreserveAspectFit
smooth: true
visible: false
source: "image.png" // 16x16 png image
}
color: "#FF" + settings.mainColor.substr(1,6)
cached: true
}
}
}
}
If I remove the ColorOverlay part, and use only the image, it runs very fast. But I need to colorize the image :/
I tried to put all the ColorOverlay+Image in a new QML file and import it to make something like this :
Column {
Repeater {
model: 100
Rectangle {
width: 16; height: 16;
color: "transparent"
Icon {}
}
}
}
But it's still very slow with the ColorOverlay :/
[EDIT 1] : Also tried the classic "Image / ColorOverlay" hierarchy, same performance results
Column {
Repeater {
model: 100
Rectangle {
width: 16; height: 16;
color: "transparent"
Image {
id: image
fillMode: Image.PreserveAspectFit
smooth: true
visible: false
source: "image.png" // 16x16 png image
}
ColorOverlay {
anchors.fill: image
source: image
color: "#FF" + settings.mainColor.substr(1,6)
cached: true
}
}
}
}
Is there a way to "duplicate" or "clone" the item ? Or maybe save the first transformation to a new PNG file in a cache directory or something ? I'm open to any idea in QML or C++!
Thanks !