Should I use GraphicalEffects directly or using layer?



  • For my desktop application, I have a Window that looks like this-

    0_1533199215953_79dc40fb-94fa-432e-8956-84c1edd8edaa-image.png

    Our design guy wants to add DropShadow to the top header and the side navigation. From what I understand I have two options-

    Rectangle {
        layer.enabled: true
        layer.effect: DropShadow {
            radius: 10.0
            samples: 16
            color: "#80000000"
        }
    }
    

    OR,

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

    I have read the docs about how layer works but I'm new to what practical considerations it would have on my application's performance.

    So, which one should I choose? What are the pros and cons?


Log in to reply
 

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