Simple RotationAnimation is not working when i specify radius for a Rectangle



  • The Rectangle is rotating with the below code.
    But when i uncomment the radius:50 it looks as circle but not rotating.
    Can somebody explain why ?
    Rectangle{
    id:circle
    x:0;y:0
    width:100
    height:100
    //radius:100
    color:"#fdb813"
    RotationAnimation on rotation {
    loops: Animation.Infinite
    from: 0
    to: 360
    running: true
    }
    }



  • Hello,

    @Srinu-kompella ,

    Its circle as it rotates u cant be able to see its rotation,

    Window{
    visible:true
    Rectangle{
    id:circle
    x:0;y:0
    width:100
    height:100
    radius:100
    color:"#fdb813"
    border.color : "blue"
    Text{
    id : text
    text : "Hello"
    anchors.centerIn : parent
    }
    RotationAnimation on rotation {
    loops: Animation.Infinite
    from: 0
    to: 360
    running: true
    }
    }
    }
    

    So add text inside the circle, u can see its rotation.

    Thanks,



  • @Pradeep-Kumar Thanks pradeep.
    I understood now. Actually circle also rotating but i am not able to visualize. Once I add the text i am able to recognize.
    I am beginner , learning qt/qml now.
    Thanks.



  • hmmmm
    glad u found the solution,
    cheers, Happy coding,

    Thanks,


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.