In my problem, I'm creating item groups which consist of a number of QGraphicsRectItem rectangles. That is, each group is a complex shape made of several overlapping rectangles. Call these "rectangle groups."
Next, I want to determine if two "rectangle groups" are colliding. I thought, "Hey, use collidesWithItem()"
So if I have group1 (which is a QGraphicsItemGroup) and also group2, I could write
group1.collidesWithItem(group2)
Well, the problem is that to determine collision it is checking the overall bounding rectangle of each group. It is not looking at it rectangle-by-rectangle. Potentially two groups could "nestle" in close to each other without any of their sub-rectangles overlapping, but that is not what it is checking.
I could write code that loops on every pair of sub-rectangles, but I'm actually working in PyQt and I'm trying to avoid writing loops in Python.
Just wondering if anyone has an idea how to do what I want without resorting to custom functionality.
Thanks,
Mike
Bookmarks