[vtkusers] Solution to vtkQt classes interaction problem

N Smethurst nick.smethurst at free.fr
Sat May 3 13:38:22 EDT 2003


Hi Dennis and everyone else.

I think I have managed to overcome this interaction continuation problem 
with the vtkQt classes. I replaced the MotionNotify case in the  
vtkQtRenderWindowInteractorCallback(..) method with a QT mouse move event
virtual method:

void vtkQtRenderWindowInteractor::mouseMoveEvent(QMouseEvent* e)
{
  if (!this->Enabled)
    return;

  int state = e->state();
  int ctrl = 0;
  if (state & ControlButton)
    ctrl = 1;
  int shift = 0;
  if (state & ShiftButton)
    shift = 1;

  int xp = e->x();
  int yp = e->y();
  yp = Size[1] - yp - 1;
  this->SetEventInformation(xp, yp, ctrl, shift);
  this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
}

Hope this helps if anyone else is having this problem.

Nick





More information about the vtkusers mailing list