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



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



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



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



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


Log in to reply
 

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