[Solved] QML Glow and DropShadow works for Text but fails for Image



  • Glow and DropShadow elements in QtGraphicalEffects 1.0 works for Text Elements But when applied for Images, it fails.

    I copy and pasted the Qt Example code but nothing happens. Displays the plain butterfly image.

    @import QtQuick 2.0
    import QtGraphicalEffects 1.0

    Item {
    width: 300
    height: 300

    Rectangle {
        anchors.fill: parent
    }
    
    Image {
        id: butterfly
        source: "images/butterfly.png"
        sourceSize: Qt.size(parent.width, parent.height)
        smooth: true
        visible: false
    }
    
    DropShadow {
        anchors.fill: butterfly
        horizontalOffset: 3
        verticalOffset: 3
        radius: 8.0
        samples: 16
        color: "#80000000"
        source: butterfly
    }
    

    }@

    Using Qt 5.1.1 in Linux Mint KDE
    also tested on Windows 7 with no results,



  • If the image contains transparent areas, then it glows, otherwise doesn't.
    Thank you


Log in to reply
 

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