Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Draw faded/feathered stroke line



  • Hello,

    Is it possible to draw a line that is faded/feathered like the below image? The blue line is slightly featured/blurred.

    0_1545998809957_Capture.JPG

    
    Item {
    
        Canvas {
            id: foregroundCanvas
            anchors.fill: parent
            visible: true
    
            onPaint: {
                var ctx = getContext("2d");
                ctx.reset();
                ctx.beginPath();
                ctx.moveTo(0.02*width,0);
                ctx.lineTo(0.02*width, 0.1*height);
                ctx.lineTo(0.95*width, 0.1*height);
                ctx.lineTo(0.95*width, 0);
                ctx.lineWidth = 3;
                ctx.strokeStyle = "#3098B1";
                ctx.stroke();
            }
        }
    }
    
    

Log in to reply