I want to create blur of blur.
Blur on ‘images’ works fine, but blur on ‘hover’ that is small button on ‘images’ doesn’t work.
This is only case when those blurs are stacked on each other
When i move bottom shader outside then top one, its seems to work fine.
Some docs
https://doc.qt.io/qt-6.5/qml-qtquick-effects-multieffect.html
https://doc.qt.io/qt-6/qml-qtquick-shadereffectsource.html
Item {
id: root
height: 123
width: 300
MouseArea {
id: rootMA
width: parent.width
height: parent.height
anchors.top: parent.top
}
Item{
id: images
anchors.fill: parent
layer.enabled: true
visible: false
Image{
id: picture1
anchors.centerIn: parent
visible: !devicePreviewImage.visible
width: 80
height: 80
source: "https://w7.pngwing.com/pngs/386/475/png-transparent-1980s-1970s-music-disc-jockey-new-wave-i-love-80-thumbnail.png"
}
Image {
id: picture2
anchors.fill: parent
source: "https://i.etsystatic.com/43797977/r/il/b1f6c3/4970064356/il_fullxfull.4970064356_odjg.jpg"
visible: index % 2
fillMode: Image.PreserveAspectCrop
}
}
ShaderEffectSource{
id: blurImages
anchors.fill: parent
sourceItem: images
layer.enabled: true
hideSource: true
layer.effect: MultiEffect{
blurEnabled: containsHover
blur: 0.5
blurMax: 32
autoPaddingEnabled: false
}
}
}
Rectangle{
id: hover
visible: rootMA.containsHover
anchors.centerIn: root
color: Qt.alpha("white", 0.20)
width: text.width + 24
height: 25
radius: 15
ShaderEffectSource{
id: buttonBlur
anchors.fill: parent
sourceItem: images
sourceRect: Qt.rect(hover.x, hover.y, hover.width, hover.height)
layer.enabled: true
layer.effect: MultiEffect{
blurEnabled: true
blur: 0.8
blurMax: 32
}
}
Text{
id: text
anchors.centerIn: parent
text: "TEST"
}
}
}
Moving buttonBlur outside the blurImages works fine, but when it’s on top of each other it’s just the copy of blurImages