QGraphicsView and eventFilter

Posted by erelender on Stack Overflow See other posts from Stack Overflow or by erelender
Published on 2010-03-15T09:12:52Z Indexed on 2010/03/18 11:01 UTC
Read the original article Hit count: 580

Filed under:
|
|
|

Hello everyone,

This has been bugging me for more than two days now, so i thought i should ask. I am using Qt 4.5.3 (compiled with VC2008) on Win7.

I have MyGraphicsView (inherits QGraphicsView) and MyFilter (inherits QObject) classes.

When i install the MyFilter object as an event filter to MyGraphicsView, Mouse events are delivered to MyFilter after they are delivered to MyGraphicsView whereas Key events are delivered to MyFilter before they are delivered to MyGraphicsView.

In the second case, i install the MyFilter object as an event filter to MyGraphicsView->viewport() (which is a standart QGLWidget), Mouse events are delivered to MyFilter before they are delivered to MyGraphicsView, whereas Key events are delivered to only MyGraphicsView.

The events are supposed to be delivered to event filters before they are delivered to the actual object, so why is this happening? What should i do to ensure this order?

Thanks in advance. Best Regards.

© Stack Overflow or respective owner

Related posts about qt

Related posts about qt4