[vtkusers] vtkEventQtSlotConnect

imran khan khan.imranh at gmail.com
Thu Feb 10 09:17:24 EST 2011


Hmmm.... that is weird as I can get mouse moves. Please see code below.

vtkEventQtSlotConnect *  connections = vtkEventQtSlotConnect::New();

..  connections->Connect(interactorROI,
                       vtkCommand::MouseMoveEvent,
                       this,
                       SLOT(handleMouseMove()));

..

// The slot
void myScene::handleMouseMove()
{
  // get event position
  int event_pos[2];
  interactorROI->GetEventPosition(event_pos);
  qDebug("Move: x=%d : y=%d\n", event_pos[0], event_pos[1]);
}



Unfortunately the mouse release of any button is still dysfunctional, which
is a travesty as this
is otherwise a very useful class. I wish someone would fix this.

Imran

On Thu, Feb 10, 2011 at 8:50 AM, Jafari, Kourosh <kjafari at rad.hfh.edu>wrote:

> Dear Imran,
>
> My name is Kourosh and I am a VTK user. I saw the following posting from
> you regarding vtkEventQtSlotConnect not being able to capture mouse release.
> I actually faced the same problem. I even cannot get the position of mouse
> when I move the mouse without clicking. Did you find any solution for this
> problem?
>
> I highly appreciate your kind help.
>
> Best regards,
>
> Kourosh Jafari-Khouzani, PhD
> Dept. of Diagnostic Radiology
> Henry Ford Hospital
> 1 Ford Place, 2F (box 82)
> Detroit, MI 48202
>
> Tel: 313-874-4378, Fax: 313-874-4494
> kjafari at rad.hfh.edu<mailto:kjafari at rad.hfh.edu>
> http://www.cs.wayne.edu/~kjafari
>
>
> P.S.
> Your posting:
>
> I have a windows application where I instrumented connecting the mouse
> events in QVTkWidget to slots and noticed that NONE of the mouse RELEASE
> events
> can be captured into a slot using vtkEventQtSlotConnect.
>  connections = vtkEventQtSlotConnect::New();
>  connections->Connect(interactorROI,
>                       vtkCommand::EnterEvent,
>                       this,
>                       SLOT(handleMouseEnter()));
>  connections->Connect(interactorROI,
>                       vtkCommand::LeaveEvent,
>                       this,
>                       SLOT(handleMouseLeave()));
>  connections->Connect(interactorROI,
>                       vtkCommand::LeftButtonPressEvent,
>                       this,
>                       SLOT(handleMouseLeftButtonPress()));
>  connections->Connect(interactorROI,
>                       vtkCommand::LeftButtonReleaseEvent,
>                       this,
>                       SLOT(handleMouseLeftButtonRelease()));
>  connections->Connect(interactorROI,
>                       vtkCommand::MouseWheelForwardEvent,
>                       this,
>                       SLOT(handleMouseWheelForward()));
>  connections->Connect(interactorROI,
>                       vtkCommand::MouseWheelBackwardEvent,
>                       this,
>                       SLOT(handleMouseWheelBackward()));
>  connections->Connect(interactorROI,
>                       vtkCommand::RightButtonPressEvent,
>                       this,
>                       SLOT(handleMouseRightButtonPress()));
>  connections->Connect(interactorROI,
>                       vtkCommand::RightButtonReleaseEvent,
>                       this,
>                       SLOT(handleMouseRightButtonRelease()));
> All other mouse events work.
>  I noticed that a couple of other folks
> Constantine Zakkaroff  adn Tamaron     : vtkEventQtSlotConnect skips
> vtkCommand::LeftButtonReleaseEvent?
> Have also experienced this. This is a very basic functionality for me to
> use the QVTKWidget. I hope someone can suggest
> a solution or a workaround.
> --
> Imran
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110210/e5f1b23e/attachment.htm>


More information about the vtkusers mailing list