Reputation: 101
I want to create a popup as the root element and the shape of the popup is shown in the image(i.e. small triangle shape)
Do qml have any property where i can define this shape (if yes then how). If no then what is the best way to customize the shape of the popup. Also is it possible to use delegate and model property for popup (if yes then how)?
Upvotes: 1
Views: 1406
Reputation: 4198
You can give a Popup
a background:
Popup {
background: Canvas {
onPaint: {
var ctx = getContext("2d")
ctx.fillStyle = "white"
ctx.beginPath()
ctx.moveTo(0,10)
ctx.lineTo(width * 0,5 - 10, 10)
ctx.lineTo(width * 0,5, 0)
ctx.lineTo(width * 0,5 + 10, 10)
ctx.lineTo(width, 10)
ctx.lineTo(width, height)
ctx.lineTo(0, height)
ctx.closePath()
ctx.fill()
}
}
}
Upvotes: 4