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

How to fill the area created by two pathAngleArcs ?



  • Hi i am trying to create an arc with a width by using two arcs and enclosing them with pathlines. How can i fill the empty area between the pathlines and patharc with some color? Shape{
    id:shape_paw

        function degreesToRadians(degrees) {
            return (degrees * Math.PI)/180;
        }
        ShapePath{
            // strokeColor: Qt.rgba(1.0, 1.0, .5, .9)
            strokeWidth: 1
            //  fillColor: "transparent"
            strokeColor: "red"
            fillColor: "blue"
            // fillColor: Qt.rgba(1.0, 1.0, .5, .8)
            // strokeColor: "transparent"
            capStyle: ShapePath.RoundCap
    
            //            PathArc{
            //                x:parent.width/2 + 7.5 +  55*Math.cos(60 * Math.PI/180)
            //                y:parent.height/2 +4+  50*Math.sin(60 * Math.PI/180)
    
            //                radiusX: 47.5;radiusY: 47.5
            //                useLargeArc: true
            //            }
            startX: (root.width*.5) + (root.width *.23)*Math.cos(shape_paw.degreesToRadians(180))
            startY: (root.height * .611) + (root.width *.23)*Math.sin(shape_paw.degreesToRadians(180))
    
            PathLine{
                x: (root.width*.5) + (root.width *.3)*Math.cos(shape_paw.degreesToRadians(180))
                y: (root.height * .611) + (root.width *.3)*Math.sin(shape_paw.degreesToRadians(180))
            }
            PathAngleArc{
    
                centerX: root.width*.5; centerY: root.height * .611
                radiusX: root.width *.3 ; radiusY: root.width *.3
                startAngle: 180
                sweepAngle: 100
                //                centerX: root.width*.5; centerY: root.height * .614
                //                radiusX: root.width *.26 ; radiusY: root.width *.26
                //                startAngle: 188.5
                //                sweepAngle: /*360*/test_degree
            }
            PathLine{
                x:  (root.width*.5) + (root.width *.22)*Math.cos(shape_paw.degreesToRadians(280))
                y:  (root.height *.611) + (root.width *.22)*Math.sin(shape_paw.degreesToRadians(280))
            }
            PathAngleArc{
                centerX: root.width*.5; centerY: root.height * .611
                radiusX: root.width *.22 ; radiusY: root.width *.22
                startAngle: 280
                sweepAngle: -100
            }
        }
        //        }
    }

Log in to reply