【发布时间】:2021-02-18 08:54:11
【问题描述】:
添加 DropShadow 后出现失真。 为什么会出现失真?
或者也许还有另一种方法可以给元素添加阴影? 这是应用程序的完整代码:main.qml - main 委托 - 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
}
}
}
【问题讨论】: