tags:

views:

228

answers:

0

I have a QGraphicsItem that clips its child items (I enabled its ItemClipsChildrenToShape flag). I noticed that clipping makes assigning the mouse event to the children items imprecise: instead of the precise shape of the items their bounding rectangles are used for detecting which item is located at the specific position so the children receive mouse events in their whole bounding rectangle. When clipping is not enabled it works fine as expected.

Setting the bounding region granularity of the child items to 1.0 didn't help. I'm using qt 4.5.0.

The program that I tested this issue with is available at http://pastebin.com/m3d0cfb53

I could not find anything about this behaviour in the qt docs. I'd like to know whether it's a bug in qt and whether there's a workaround for it.