Try installing the event filter in the graphicsview's viewport widget.
Cheers,
_
Try installing the event filter in the graphicsview's viewport widget.
Cheers,
_
Thanks a lot for your input . I replace the code as following. After this the graphicView stopped taking mouse eventsQt Code:
ui->graphicsView->viewport()->installEventFilter(this);To copy to clipboard, switch view to plain text mode![]()
Are you returning false in your event filter when you are not handling the event?
Cheers,
_
No, where shall i do that?
In my code if the event is not taken it goes to the else block of the eventFilter() and the event is passed to QWidget::eventFilter(obj,event);
The eventFilter() method needs to return either true or false, depending on whether it has consumed the event or not.
Maybe you could post the actual code?
The snippet you posted earlier does not return anything in any of the other branches. If that results in eventFilter() being evaluated as true, then mouse press/release and key press never make it to the actual target.
Cheers,
_
Bookmarks