Shadow for Rectangle and Circle.



  • How will shadow create for Ractangle and Circle by means of DropShadow that happen like this http://i.stack.imgur.com/dxpcN.png

    I do so:

    Item {
        Rectangle {
            id: rect
            anchors.fill: parent
        }
        
        DropShadow {
            anchors.fill: rect
            radius: 18.0
            samples: 16
            color: "#80000000"
            source: rect
        }
    }
    

    but it do not work.



  • use RectangularGlow instead.



  • Well, first you need to enable layer and then set layer effect by DropShadow for example check my sample:

     layer.enabled: true
            layer.effect: DropShadow {
                horizontalOffset: 0;
                radius: 8
                samples: 16
                source: {YourRectangleId}
                color: "#20000000"
                verticalOffset: 0;
                transparentBorder: true
                spread: 0
            }
    

Log in to reply
 

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