Results 1 to 3 of 3

Thread: QGraphicsEllipseItem with Handles

  1. #1
    Join Date
    Apr 2008
    Posts
    29
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default QGraphicsEllipseItem with Handles

    I am trying to create a QGraphicsEllipseItem with resize handles. I have already got a QGraphicsRectItem that is working well, but my resize handles on my Ellipse don't respond to clicks because they are outside the shape. (I.e. inside the bounding Rect, but outside the shape.)

    What do I need to override to make it so that you can click on the handles. I have tried overriding contains, but it doesn't seem to be working. (Although I may just have a problem in the code.) What I need is to override the code that decides if a click on the item is really on the item, or not. If I just respond to the mouse down event, it's already too late.

    Thanks for any suggestions,

    -SteveL

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsEllipseItem with Handles

    You need to override shape() to include the handles when the item is selected. You can also position the handles on the ellipse itself

  3. #3
    Join Date
    Apr 2008
    Posts
    29
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: QGraphicsEllipseItem with Handles

    I was reluctant to override shape, as I didn't want to change the basic shape of the object, but I'll try only overriding it when it's selected, and see how that works.

    Thanks.

Similar Threads

  1. Rotating QGraphicsEllipseItem, but keeping its location
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2012, 12:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.