QML给Rectangle添加阴影
1.
import QtGraphicalEffects 1.15 Rectangle { id: frame width: root.width height: root.height anchors.centerIn: parent color: "#2B2B2B" radius: 6 layer.enabled: true layer.effect: DropShadow { horizontalOffset: 3 // 水平偏移 verticalOffset: 3 // 垂直偏移 radius: 8.0 // 模糊半径 samples: 16 // 阴影采样数(影响平滑度) color: "#80000000" // 阴影颜色(带透明度) } }
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html