Hi Matt How do you yourself know that the particular Target is on top? There got to be some property controlling it, right? In the simplest case you can use the Item's z property for it. Then if both Targets intersect with the ball, whichever got bigger z-coordinate is the boss.
Best regards, Artem. On Aug 5, 2011, at 1:47 AM, Matt Barclay wrote: > Hello, > > I have a bouncing ball and 2 moving rectangle targets. The Target items use > mapFromitem() on the ball's x/y coordinates to determine if the ball is over > the target. However, it's possible for the targets to overlap each other, in > which case they both think the ball is over them. But the ball is only > allowed to be over one target. > > Is there a way for the Target item to figure out if its the top-most Target > so it can take control of the ball?? Something similar to > QGraphicsScene::items( QPoint ) ? > > I can't use Item.childAt() because I have some other transparent layers at > the very top that do mouse tracking and pop-up notifications. > > Thanks! > Matt > > _______________________________________________ > Qt-qml mailing list > [email protected] > http://lists.qt.nokia.com/mailman/listinfo/qt-qml _______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
