0

I've got 3 basic elements in a rectangle and I'd like to draw line separations between them.
I don't find an easy way to achieve that, as a border-left would do in CSS.

Text {
    id : txtNote
    text : (__notes.length>0)?__notes[0].extname.name:"--"
    anchors.right: txtNoteAcc.left
    leftPadding: 5
    rightPadding: 0
}

Image {
    id : txtNoteAcc
    height : 20
    width : 20
    anchors.right: txtNoteHead.left
}

Image {
    id : txtNoteHead
    height : 20
    width : 20
    anchors.right: parent.right
}

Now laid out as:

enter image description here

And the goal is to have it a similar way (this example is a Java one):

enter image description here

I've found this approach, but I don't call it "simple" and it is 7 years old.

Rem: I'm working with QML 5.9 (so Shape is not available).

lvr123
  • 524
  • 6
  • 24
  • To draw a line, just use a `Rectangle` with a width of `1`. Does that work? – JarMan Jan 26 '21 at 16:44
  • No. This draws a line all around. I'm looking for a line on the left and right sides only. Like in CSS ```border-width: 0px 1px;``` – lvr123 Jan 26 '21 at 19:46
  • 1
    No it doesn't. Using `border.width` would put a border all the way around a Rectangle. But I suggested using `width`, not `border.width`. Just position the Rectangle on the left or right. I'm not understanding what the problem is. – JarMan Jan 26 '21 at 19:50
  • Ok. Got it. Use a rectangle as a border. It is working fine. Thanks. – lvr123 Jan 26 '21 at 20:34

0 Answers0