[SOLVED] Refresh blur effect



  • Hello,

    I wanto to create a effect for a backgroundImage. The images can change so it is necessary that the blur effect is reapplied. However the QML blur effects seems to be refreshed only on creation time. Is there a way to force refreshing the blur effect?


  • Moderators

    If you are using things like FastBlur and friends, they can be controlled simply by using NumberAnimation, so you have full control over when the animation should run.

    It's hard to be more specific without more details from your side.



  • @Image {
    property bool effectEnabled: true

            id: backgroundImage
            anchors.fill: parent
            source: master.backgroundImage
    
            GaussianBlur {
                id: backgroundBlur
    
                anchors.fill: parent
                visible: parent.effectEnabled
                source: parent
                radius: 8
                samples: 16
                transparentBorder: false
            }
    

    }@
    When I change the master.backgroundImage the blur effect does not update. What do you mean by using the NumberAnimation on the blur effect?



  • Try like this...
    @
    Image {
    id: myImage
    property bool effectEnabled: true

    id: backgroundImage
    anchors.fill: parent
    source: master.backgroundImage
    }

    GaussianBlur {
    id: backgroundBlur

    anchors.fill: myImage
    visible: myImage.effectEnabled
    source: myImage
    radius: 8
    samples: 16
    transparentBorder: false
    }
    @

    if it doesn't work put you image inside a loader that it will do the trick...



  • Thank you. I tried everything expect moving the Blur outside the Image Component that seems to fix the problem.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.