令我惊讶的是,该Image组件没有radius属性.我尝试通过将图像放在圆形中来模拟圆角Rectangle,但它不会剪切角落.
Rectangle {
anchors.right: rectContentBg.left
anchors.top: rectContentBg.top
anchors.margins: 8
radius: 8
width: 64
height: 64
Image {
id: imgAuthor
opacity: 1
smooth: false
anchors.fill: parent
source: "qrc:/res/sample_avatar.jpg"
}
}
Run Code Online (Sandbox Code Playgroud)
如何正确创建圆角图像?