添加DropShadow后會出現失真。為什么會出現扭曲?
QML ListView Distortions:
或者有其他方法可以給元素添加陰影?下面是應用程序的完整代碼:main.qml-main delegate-propertiesview
delegate: PropertiesView {
id: delegateElement
anchors.left: parent.left
anchors.leftMargin: 10
anchors.right: parent.right
anchors.rightMargin: 10
background: Rectangle {
id: elementDevice
implicitWidth: 100
implicitHeight: 40
opacity: enabled ? 1 : 0.3
color: delegateElement.down ? "#dddedf" : "#eeeeee"
}
DropShadow {
anchors.fill: parent
cached: true
horizontalOffset: 3
verticalOffset: 3
radius: 8.0
samples: 16
color: "#80000000"
source: parent
}
}
}
Try This