Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Some issues with rotation of buttons inside a circle

Some issues with rotation of buttons inside a circle

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.4k 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 wanted to partition a circle into 5 clickable area (buttons) using QML so when I click on any area of them , the circle should rotate until this area reach the middle of the left side of the window then stop.

    This is what I have done so far :
    "Before rotation":http://postimg.org/image/tkfiblfpr/
    "After rotation":http://postimg.org/image/5rlzbmja1/

    The issues I have right now :

    1- The clickable area is in the shape of a rectangle or a circle but I need every area of the 5 to be clickable and they are in a shape of an arc.

    2- The text inside each area became upside down or rotated by an angle after rotation while I don't want it to rotate while moving on the circle .

    3- how can I add this circle as a part of QT widget GUI ?

    Thanks in advance.

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

      MouseArea is specified in width*height. So it is shape of rectangle. If you define the MouseArea for entire rectangle you should be able to get the mouse clicks.

      Since you are rotating the entire circle, items inside will also get rotated. You need to separate out text area and rotate the text in opposite direction of your circle movement.

      Please look QWidget::createWindowContainer(...) in Qt Assistant.

      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 for replying and both answers for the last two questions are indeed what I was looking for , thanks :)

        But I don't get what you mean by defining the MouseArea for entire rectangle , I want each area or arc of the 5 to act like a button so they can't be in the shape of a rectangle , the clickable area for each one of them must be in the shape of an arc , can that be done in QML ?

        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