[vtkusers] QVTKRenderWindowInteractor focus policy

Clinton Stimpson clinton at elemtech.com
Wed Aug 29 14:29:02 EDT 2012


That does look wrong!
We should remove it and simply let the focus policy do its work.

Right now that is 
self.setFocusPolicy(QtCore.Qt.WheelFocus)

As for why it does that, I'm not sure.  It was that way in the very beginning 
in 2005 when the original author added qt/QVTKRenderWindowInteractor.py.

Clint

On Wednesday, August 29, 2012 01:58:46 PM Félix C. Morency wrote:
> Hi all,
> 
> The default behaviour of the QVTKRenderWindowInteractor is to steal
> the focus when the mouse enters the widget:
> 
>     def enterEvent(self, ev):
>         if not self.hasFocus():
>             self.__oldFocus = self.focusWidget()
>             self.setFocus()
> 
> Is there a reason for this default behaviour?
> 
> I'm in the case where I have multiple subwindows in a MdiArea
> rendering QVTKRenderWindowInteractor. Each time the mouse hovers one
> of the subwindow, the focus is stolen even if my (Qt) focus policy is
> different. If I remove the focus stealing code, things works as
> expected.
> 
> --
> Félix C. Morency, M.Sc.
> Plateforme d’analyse et de visualisation d’images
> Centre Hospitalier Universitaire de Sherbrooke
> Centre de recherche clinique Étienne-Le Bel
> Local Z5-3031 | 819.346.1110 ext 16634
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com



More information about the vtkusers mailing list