Re: Problem in Mouse Events
Try installing the event filter in the graphicsview's viewport widget.
Cheers,
_
Re: Problem in Mouse Events
Thanks a lot for your input . I replace the code as following
Code:
ui->graphicsView->viewport()->installEventFilter(this);
. After this the graphicView stopped taking mouse events :(
Re: Problem in Mouse Events
Are you returning false in your event filter when you are not handling the event?
Cheers,
_
Re: Problem in Mouse Events
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);
Re: Problem in Mouse Events
Quote:
Originally Posted by
anirudh123
No, where shall i do that?
The eventFilter() method needs to return either true or false, depending on whether it has consumed the event or not.
Quote:
Originally Posted by
anirudh123
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);
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,
_