GraphicsSceneMouseRelease don't works on top item
Hi!
I have two QGraphicsRectItems on a QGraphicsScene. Firts item is parent of second one. On the second item I have installed filter which simply prints message string on press and release event. If filter is installed on the second item, "Release" message will never show. Why? If filter on first, its all OK - both messages are appears.
http://qtnode.net/index.php/pastebin/5386
compilable example - http://www.creobyte.com/tools/releaseevent.zip
Re: GraphicsSceneMouseRelease don't works on top item
Re: GraphicsSceneMouseRelease don't works on top item
I didn't try it, but I would guess that the problem is that your second item is not part of the scene (see how you allocated it in comparison to the first one, which is IN the scene).
The second item is just an allocated item, belongs to no scene, and the filter filters *scene* events.
Re: GraphicsSceneMouseRelease don't works on top item
No, that is not problem. I was not added secondItem to scene, but I set to it firstItem as its parent:
Code:
secondItem->setParentItem(firstItem);
So now secondItem is valid member of scene too.
But even if you are right, why then we can see "Pressed" message? ;)