How do I implement a Rectangle in QML with an inner shadow?
See example in link below:
UPDATE:
Here's a simplified version of what I'm trying to do (which does not show any shadow):
import QtQuick 2.0
import QtGraphicalEffects 1.0
Item {
width: 400
height: 400
Item {
anchors.fill: parent
Rectangle {
id: myRectangle
anchors.centerIn: parent
width: 200
height: 200
color: "grey"
}
}
InnerShadow {
anchors.fill: myRectangle
cached: true
visible: true
horizontalOffset: 0
verticalOffset: 0
radius: 25
samples: 16
color: "#b0000000"
smooth: true
source: myRectangle
}
}
I'm sorry. My stupid... I got it wrong when i simplified the code (the Item was used for a DropShadow test, which works). This is how it was supposed to look like:
import QtQuick 2.0
import QtGraphicalEffects 1.0
Item {
width: 400
height: 400
Rectangle {
id: myRectangle
anchors.centerIn: parent
width: 200
height: 200
color: "grey"
}
InnerShadow {
anchors.fill: myRectangle
cached: true
visible: true
horizontalOffset: 0
verticalOffset: 0
radius: 25
samples: 16
color: "#b0000000"
smooth: true
source: myRectangle
}
}