How to get child QGraphicsItem to ignore input events
-
I feel like I should know this by now, but is there a way to have a child QGraphicsItem pass all input events to its parent?
Right now I have a parent item that draws a simple shape and a child QGraphicsTextItem that just draws a number in the middle of that shape. The child is grabbing mouse events so that I can't drag the parent. I just want the child to ignore or pass all input events on to the parent.
Thanks!
-
I feel like I should know this by now, but is there a way to have a child QGraphicsItem pass all input events to its parent?
Right now I have a parent item that draws a simple shape and a child QGraphicsTextItem that just draws a number in the middle of that shape. The child is grabbing mouse events so that I can't drag the parent. I just want the child to ignore or pass all input events on to the parent.
Thanks!
-
@kshegunov said in How to get child QGraphicsItem to ignore input events:
Hi,
Is this what you're looking for?Close, but as far as I can tell this method would prevent dragging of some child items. Some of my child items are still meant to be draggable. I am looking to prevent input from only a subset of items.
-
@kshegunov said in How to get child QGraphicsItem to ignore input events:
Hi,
Is this what you're looking for?Close, but as far as I can tell this method would prevent dragging of some child items. Some of my child items are still meant to be draggable. I am looking to prevent input from only a subset of items.
@patrickkidd said in How to get child QGraphicsItem to ignore input events:
Close, but as far as I can tell this method would prevent dragging of some child items. Some of my child items are still meant to be draggable. I am looking to prevent input from only a subset of items.
I think (take it with a grain of salt), that if you filter out the event, you
accept()it, but if you don't and call the base implementation ofevent()you should see it sink to the child.