Results 1 to 2 of 2

Thread: QGraphicsScene intersection problem

  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QGraphicsScene intersection problem

    Hi all,
    I have a QGraphicsItem who contains 2 children on the border (a circle for each child).
    When I use the function "items" the cursor needs to be on the parent to have children on the list but the circle is a bit outside the parent item.
    That cause problem that if you click on the circle part who is outside, "items" doesn't add it in the list.
    What is the good method to have all working ?
    Thanks for the help

  2. #2
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsScene intersection problem

    I have log and I found that all works.
    The real problem is if the child is selected the scene can be dragged but I would block that, I don't know if it's possible.
    The dragging is blocked only if the parent who is added in the scene is selected.
    Thanks for the help

    UPDATE : I resolved by adding "setFlag( QGraphicsItem::ItemIsSelectable );" on the child.
    If a better way exist thanks to say it, hack needs to be added to remove the rectangle around him when this flag is set.
    Last edited by Alundra; 17th October 2013 at 03:53.

Similar Threads

  1. diagram scene example - intersection test
    By sajis997 in forum Newbie
    Replies: 12
    Last Post: 14th September 2011, 17:48
  2. How to find the intersection point of polylines
    By arashadsaifi in forum Qt Programming
    Replies: 1
    Last Post: 3rd December 2009, 10:12
  3. Finding intersection point
    By zgulser in forum Qt Programming
    Replies: 2
    Last Post: 14th October 2009, 08:49
  4. finding the Intersection of two lines
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 8th June 2008, 13:16
  5. Find point of intersection/overlaping?
    By Morea in forum Qt Programming
    Replies: 9
    Last Post: 19th April 2007, 14:42

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
  •  
Qt is a trademark of The Qt Company.