I'm building my own QML Dialog. Therefore I want to make a header, content and footer item. The Dialog should have rounded corners (Rectangle.radius) but the Header/Footer should be a normal Rectangle.
Heres my code:
Rectangle {
width: 360
height: 360
Rectangle {
id: dialog
anchors.centerIn: parent
width: 200
height: 300
radius: 20
border.color: "gainsboro"
Rectangle {
id: header
width: dialog.width
height: 50
border.color: "red"
Text {
anchors.centerIn: parent
text: "HEADER"
}
}
Rectangle {
id: footer
anchors.bottom: dialog.bottom
width: dialog.width
height: 50
border.color: "green"
Text {
anchors.centerIn: parent
text: "FOOTER"
}
}
}
}
The problem is, that the Dialog does not have rounded corners, because the header and footer are overlapping the dialog Rectangle. I would like to know how to avoid that.
Thanks in advance!