Image {
id: img
width: 241
height: 241
anchors {
top: parent.top
topMargin: 197
left: parent.left
leftMargin: 106
}
source: ""
fillMode: Image.PreserveAspectFit
visible: true
}
Image {
id: reflectionImage
source: img.source
width: img.width
height: img.height
visible: true
anchors {
top: img.bottom
topMargin: img.height
left: parent.left
leftMargin: 106
}
transform: Scale {
yScale: -1
}
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
width: reflectionImage.width
height: reflectionImage.height
gradient: Gradient {
GradientStop {
position: 0.5
color: "transparent"
}
GradientStop {
position: 1.7
color: "black"
}
}
}
}
}标签:倒影,img,top,height,width,qml,left,true,图片 From: https://www.cnblogs.com/lllion/p/18609945