[vtkusers] Detect which QVTKWidget I am interacting with

Girault, Alexis girault at email.unc.edu
Tue Jul 23 11:38:32 EDT 2013


Hey all, let me rephrase my question, I guess it was way too long,

I want to detect which QVTKWidget I am interacting with, for example when i just click on it.

I create multiple QVTKWidgets this way, and I add them in a layout to display (scrollAreaWidgetContents), and a list to access (widgetList) :
      QVTKWidget *meshWidget = new
      QVTKWidget(this->scrollAreaWidgetContents);
      this->widgetList->append(meshWidget);

I usually access them this way (to render everything for example or connect to a unique camera) :
      for (int i = 0; i < this->widgetList->size(); i++)
      {
          this->widgetList->value(i)->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->SetActiveCamera(headcam);                                       //connect to headcam for synchro
          this->widgetList->value(i)->GetRenderWindow()->AddObserver(vtkCommand::RenderEvent, this, &ShapePopulationViewer::ModifiedHandler);  //syncronize when rendering
      }

Therefore when i click on one of them, I'd like to get the "i value" inside the widgetList, or simply a pointer on the QVTKWidget I selected.

I tried with "vtkObject::AddObserver", and "qobjet::connect" but I could not find a solution.

Thanks for your time,

Regards,
Alexis


More information about the vtkusers mailing list