How to load different Path in Shape?
Unsolved
QML and Qt Quick
-
I'm writting a new
Rectangle
that allows differentborder.width
andradius
of each corner. Whenradius > 0
, it should paint an arc, whenradius === 0
, it shouldn't paint the arc. I've implemented the case withradius > 0
, but I don't know how to disable the arc properly. The following code is the code of drawing left bottom cornerCornerGradient { id: leftBottomGradient x2: 0 y2: root.height - (bottomBorder.width + leftBottomRadius) x1: leftBorder.width + leftBottomRadius y1: root.height startColor: bottomBorder.color endColor: leftBorder.color } ShapePath { fillGradient: leftBorder.color !== bottomBorder.color ? leftBottomGradient : null fillColor: leftBorder.color strokeColor: "transparent" PathAngleArc { centerX: leftBorder.width + leftBottomRadius centerY: root.height - (bottomBorder.width + leftBottomRadius) startAngle: 90 sweepAngle: 90 radiusX: leftBottomRadius radiusY: leftBottomRadius } PathLine { x: 0 y: root.height - (bottomBorder.width + leftBottomRadius) } PathAngleArc { centerX: leftBorder.width + leftBottomRadius centerY: root.height - (bottomBorder.width + leftBottomRadius) startAngle: 180 sweepAngle: -90 radiusX: bottomBorder.width + leftBottomRadius radiusY: leftBorder.width + leftBottomRadius } PathLine { x: leftBorder.width + leftBottomRadius y: root.height - bottomBorder.width } }