Page MenuHomePhabricator

MITK's interaction not the first to handle events anymore -- QVTKOpenGLWidget::event() changed since VTK 7.0.0 (MITK 2016.11)
Open, HighPublic

Description

In MITK 2016.11 the intention of QmitkRenderWindow was: handle Qt mouse events inside MITK and only if no MITK interactor is interested, then show the Qt event to QVTKOpenGLWidget, let it do further handling such as telling VTK interactors about it.

This intention seems still valid and helpful. It allows, for example, to implement a MITK interactor that would change a paint brush radius via "modifier+mouse wheel". MITK would do that and VTK would neven attempt to do zooming because of the mouse wheel.

In MITK 2018.04 (and, looking at the sources, current master) QVTKOpenGLWidget changed considerably and QmitkRenderWindow did not. Consequently, the Qt events are now always _first_ processced by VTK's interactors (in the example: execute zooming) and only afterwards handled by QmitkRenderWindow and MITK interactors. This breaks interactions as the paint brush example above.

I am surprised that nobody ran into this yet (no interactors that use the mouse wheel anywhere in DKFZ?). Anyway I need this fixed in my application and will attempt to work on a fix soon. I would appreciate if somebody from the DKFZ team could support with review and testing (I guess there are quite some interactions implemented on your side and I lack overview)

@kislinsk @nolden

Event Timeline

maleike created this task.Oct 14 2019, 5:28 PM

@hempe @kalali Maybe related to the flickering render window menu issues?

Actually, @hempe informed me that the render window menu is not flickering anymore in the latest stable release (if you mean with flickering: not being able to use the render window until you click inside the render window to set its focus).
I wanted to take a look into the diff this week.

maleike added a comment.EditedOct 15 2019, 5:47 PM

I tried the idea described above today and it fixes the behavior of my interactor that uses the mouse wheel in a 3D window. With this patch the MITK interactor gets to see the event first and can decide whether or not is is handled.

I also tested another interactor which seems fine. However, I did not test any other interactors yet. If you have feedback on any problems with the above patch, I would happily either look into it or assist in improving it.

I think my changes are pretty straight-forward but please let me know if something is unclear. I'd try to make this patch a branch on Github soon

kislinsk claimed this task.Oct 17 2019, 9:27 AM
kislinsk triaged this task as High priority.
kislinsk edited projects, added MITK (2018-04-4); removed MITK.