I'm trying to draw a line with faded ends in QML, similar to this one:
I tried drawing the line using a rectangle but I don't know how to fade out the ends.
I am using Qt 5.12.
I'm trying to draw a line with faded ends in QML, similar to this one:
I tried drawing the line using a rectangle but I don't know how to fade out the ends.
I am using Qt 5.12.
Stephen Quan
On
You can also use RadialGradient:
RadialGradient {
anchors.centerIn: parent
width: 400
height: 5
gradient: Gradient {
GradientStop { position: 0.0; color: "white" }
GradientStop { position: 0.5; color: "black" }
}
}
You can Try it Online!

You can use the Rectangle item both with Gradient, for example: