Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Simple RotationAnimation is not working when i specify radius for a Rectangle
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Srinu kompellaS Offline
    Srinu kompellaS Offline
    Srinu kompella
    wrote on last edited by
    #1

    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
    }
    }

    1 Reply Last reply
    0
    • Pradeep KumarP Offline
      Pradeep KumarP Offline
      Pradeep Kumar
      wrote on last edited by
      #2

      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
      Qt,QML Developer

      Srinu kompellaS 1 Reply Last reply
      3
      • Pradeep KumarP Pradeep Kumar

        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,

        Srinu kompellaS Offline
        Srinu kompellaS Offline
        Srinu kompella
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        1
        • Pradeep KumarP Offline
          Pradeep KumarP Offline
          Pradeep Kumar
          wrote on last edited by
          #4

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

          Thanks,

          Pradeep Kumar
          Qt,QML Developer

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved