[Solved] Column with border
-
Is it possible to create a border around a Column element?
I have tried to create a Rectangle around it:
@
Rectangle
{
color: "blue"
radius: 5
border.color: "black"
border.width: 5Column { id: column anchors.fill: parent anchors.margins: 10 ... }
}
@But the rectangle is not visible. Maybe I'm missing a property?
Neither the background nor the border is visible. -
Cannot see why that would not work. In fact, the following works just fine for me:
@
import QtQuick 1.0Rectangle {
width: 100
height: 100color: "blue" radius: 5 border.color: "black" border.width: 5 Column { anchors.fill: parent anchors.margins: 10 Text { text: "Hello" } Text { text: "World" } }
}
@ -
Thank you, I have set the height and width to the column.height and column.width. But this doesn't work. (Also anchors.fill: column) does not work.
Do I always have to set these properties statically?
edit: it is working now!
@
Rectangle
{
id: rectangle
color: "#f3f3f3"
radius: 5
border.color: "#5e5b5b"
border.width: 2
width: 640;Column { id: column objectName: "column" anchors.margins: 1 anchors.left: parent.left anchors.right: parent.right rectangle.height = height ... }
}
@