Are soft edge drop shadows possible? (as in the docs)



  • Update: Ok, poking around for a while, it appears that the "transparentBorder" property needs to be set to true in order to get soft edges. Didn't see this mentioned in the docs.

    image

           DropShadow {
                anchors.fill: rect
                horizontalOffset: 20
                verticalOffset: 20
                radius: 16
                cached: true
                transparentBorder: true // <----------- TRUE
                fast: true
                samples: 16
                spread: 0
                color: "#80000000"
                source: image
            }
    

    Original Issue
    I've been unable to get a soft edge drop shadow on an image no matter what settings I try. The docs indicate that this is possibe by adjusting the DropShadow - Radius property but it's not working. I get the following result with the code below:

    image

    Am I doing something wrong or is this a bug/known issue?

        Rectangle {
            id:rect
            width: 320
            height: 240
            color: "blue"
    
            Image {
                id: image
                anchors.fill: parent
                source: "qrc:/images/image1.png"
            }
    
            DropShadow {
                anchors.fill: rect
                horizontalOffset: 10
                verticalOffset: 20
                radius: 8.0
                samples: 16
                spread: .2
                color: "#000000"
                source: image
            }
        }

Log in to reply
 

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