如何在使用边框图像时设置红色轮廓边框



我正在使用BorderImage在GridView上显示图像。

以下是我正在做的事情:

BorderImage {
source: some_image
asynchronous: true
cache: false
}

我想为我的图像设置红色轮廓边框我该怎么做

我看了看Border.leftBorder.right属性,但它们只是拉伸了图像。

您可以向(Border)Image添加Rectangle

BorderImage {
source: some_image
Rectangle {
anchors.fill: parent
anchors.margins: -border.width
z: -1
border.width: 4
color: 'red'
}
}

最新更新