Why does GroupBox not have a Border attribute in QML?
-
What's wrong with the following code?
GroupBox { title: qsTr("Synchronize") border{color:"#FF0000"} }
@mirro GroupBox has no property named border -> no direct change, you could use the background property to define your own background :
GroupBox{ id: control title: qsTr("Some Text") anchors.fill: parent anchors.margins: 10 background: Rectangle { y: control.topPadding - control.padding width: parent.width height: parent.height - control.topPadding + control.padding color: "transparent" border.color: "#21be2b" radius: 2 } }
-
@mirro GroupBox has no property named border -> no direct change, you could use the background property to define your own background :
GroupBox{ id: control title: qsTr("Some Text") anchors.fill: parent anchors.margins: 10 background: Rectangle { y: control.topPadding - control.padding width: parent.width height: parent.height - control.topPadding + control.padding color: "transparent" border.color: "#21be2b" radius: 2 } }
@J-Hilk said in Why does GroupBox not have a Border attribute in QML?:
background property
How do I set the background property Image?
-
@J-Hilk said in Why does GroupBox not have a Border attribute in QML?:
background property
How do I set the background property Image?
-
@J-Hilk
thanks a lot.I'd like to ask last question.How is the repaint() of GroupBox defined in QML?
-
I believe it isn't.
GroupBox only handles the visual logic (properties and positionning).
The painting is done by its background item, its contentItem item and label item.Generally controls are a skeleton and delegate the painting to their child item