<div dir="ltr"><div><div><div><div>You may solve it in using Qt ways.<br><br></div>QVTKWidget is derived from QWidget.<br></div><div>Active widget will have a focus.<br></div><div><br></div>So you either may iterate over your QVTKWidget to check which one has a focus or override QWidget::focusInEvent / install event hsandler to find out whyen focus changed.<br>
<br></div>Regards,<br></div> Alex<br><div><div><br><br><div><br><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 23, 2013 at 8:38 AM, Girault, Alexis <span dir="ltr"><<a href="mailto:girault@email.unc.edu" target="_blank">girault@email.unc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey all, let me rephrase my question, I guess it was way too long,<br>
<br>
I want to detect which QVTKWidget I am interacting with, for example when i just click on it.<br>
<br>
I create multiple QVTKWidgets this way, and I add them in a layout to display (scrollAreaWidgetContents), and a list to access (widgetList) :<br>
<div class="im"> QVTKWidget *meshWidget = new<br>
QVTKWidget(this->scrollAreaWidgetContents);<br>
this->widgetList->append(meshWidget);<br>
<br>
</div>I usually access them this way (to render everything for example or connect to a unique camera) :<br>
<div class="im"> for (int i = 0; i < this->widgetList->size(); i++)<br>
{<br>
</div> this->widgetList->value(i)->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->SetActiveCamera(headcam); //connect to headcam for synchro<br>
this->widgetList->value(i)->GetRenderWindow()->AddObserver(vtkCommand::RenderEvent, this, &ShapePopulationViewer::ModifiedHandler); //syncronize when rendering<br>
}<br>
<br>
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.<br>
<br>
I tried with "vtkObject::AddObserver", and "qobjet::connect" but I could not find a solution.<br>
<br>
Thanks for your time,<br>
<br>
Regards,<br>
Alexis<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>