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. [SOLVED]Rotation of a set of buttons in a circle.

[SOLVED]Rotation of a set of buttons in a circle.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.8k Views 1 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.
  • M Offline
    M Offline
    Mohammedbie
    wrote on last edited by
    #1

    Hi , I want to make a circle/ellipse containing 5 buttons circles(like a point changing places on its Circumference) while making buttons switch places when the user clicks on one button of them , the circle should continue to circle until the button clicked reach the left side of the circle/ellipse and then a window related with this button opens next to the main window .

    The reason I want the circle to circle (sorry for the confusion :P ) is that it should be partitioned into 5 areas each area containing a button and separated form other areas by lines so if the buttons did the movement , they would cross those lines.

    unfortunately, I couldn't find a way to do that as above so I dropped the idea of partitioning the circle and used QPropertyAnimation to animate the movement of each button and tried to make it looks like the ellipse was circling but it didn't appear as intended.

    That what I achieved so far : "Animated movements of buttons.":https://www.youtube.com/watch?v=XyEI516dwE4&feature=youtu.be

    Is there a way to make a circle/ellipse circles as described or at least make it appears that way ?

    Thanks.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      You can achieve this in QML and RotationAnimation together. You can use the rotation property of QML element and positioning them at appropriate x and y. You can calculate x and y using mathematical functions.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mohammedbie
        wrote on last edited by
        #3

        Thanks , that was very helpful and did exactly what I need.

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          Cool. You can move the question to solved state by editing the question to <SOLVED>

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0

          • Login

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