PDA

View Full Version : Propagation of mouse events in QMainWindow



fredheigl
19th April 2012, 08:41
Hi! I have a class Editor that extends QMainWindow and has another class View that extends QGLWidget as its CentralWidget. Currently:
- the View widget paints things on screen when the mouse button is pressed and dragged (when run as a standalone widget)
- when View is embedded as a CentralWidget, clicking on it does nothing

I have found that handling mouse events in the Editor and then calling the event handlers in View with the respective events works but I'm not sure why it doesn't work without this workaround.

What I'm curious about though is how the mouse events are being propagated and why the workaround is necessary or whether I'm doing something wrong.

Thanks!
Fred