[Qt-interest] Detecting collisions with a particular boundary of an item
Ben Hood
0x6e6562 at gmail.com
Fri Feb 26 01:41:16 CET 2010
Hi,
I have a rectangular QGraphicsItem that can contain smaller
QGraphicsItems. Currently I'm implementing shape() to detect whether
the smaller items collide with the larger item.
I'd like to be able to detect when a smaller item collides with the
left or right side of the containing item. I'm considering adding
callbacks on the containing item that return a new QGraphicsItem
representing just its left or right hand side, which, in turn I can
use to with the collidesWith() function of the smaller item.
This seems to be a bit of a hack - I was wondering if there is a more
declarative way to detect when an item collides with a particular
section of a logical boundary. I've gone through the API to see if
something like this exists, but most of the boundingRegion-esque calls
are designed to be consumed by the view renderer. Is there something
I'm missing?
Thanks,
Ben
More information about the Qt-interest-old
mailing list