[vtkusers] QVTKWidget mouse event in python

Eric E. Monson emonson at cs.duke.edu
Fri Sep 17 09:04:52 EDT 2010


Hey Nicola,

I haven't used this myself, so hopefully someone else can also help with more details, but I think what you need to use is vtkEventQtSlotConnect:

http://www.vtk.org/doc/nightly/html/classvtkEventQtSlotConnect.html

On that page there are links to two examples (C++) and a test (Python). The Python test is pretty minimal, so you'll probably have to look at those cxx tests to get more ideas of how to use it. I think the Qt events example in [vtk_src]/Examples/GUI/Qt/Events/GUI4.cxx will be most useful.

Good luck,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Sep 17, 2010, at 6:52 AM, Nicola Creati wrote:

> Hello,
> I'm using the new QVTKWidget wrapped in python and I need to capture mouse events. If I add an observer to the interactor style I can easly capture any mouse event. On the Qt side I cannot get any mouse events occurring in my QVTKWidgets. Is there a way to get it?
> 
> Thanks.
> 
> Nicola
> 
> -- 
> Nicola Creati
> Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS www.inogs.it Dipartimento di Geofisica della Litosfera Geophysics of Lithosphere Department CARS (Cartography and Remote Sensing) Research Group http://www.inogs.it/Cars/ Borgo Grotta Gigante 42/c 34010 Sgonico - Trieste - ITALY ncreati at ogs.trieste.it
> off.   +39 040 2140 213
> fax.   +39 040 327307
> 
> _____________________________________________________________________
> This communication, that may contain confidential and/or legally privileged information, is intended solely for the use of the intended addressees. Opinions, conclusions and other information contained in this message, that do not relate to the official business of OGS, shall be considered as not given or endorsed by it. Every opinion or advice contained in this communication is subject to the terms and conditions provided by the agreement governing the engagement with such a client. Any use, disclosure, copying or distribution of the contents of this communication by a not-intended recipient or in violation of the purposes of this communication is strictly prohibited and may be unlawful. For Italy only: Ai sensi del D.Lgs.196/2003 - "T.U. sulla Privacy" si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario.
> _____________________________________________________________________ 
> _______________________________________________
> 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




More information about the vtkusers mailing list