<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 10, 2010, at 8:06 PM, David Doria wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div><div>This works for me.</div></div>
</div><div><br></div><div><div><br></div><div>int main(int argc, char** argv)</div><div>{</div><div>&nbsp;&nbsp;QApplication app(argc, argv);</div><div>&nbsp;&nbsp;QVTKWidget w;</div><div>&nbsp;&nbsp;w.resize(400,400);</div><div>&nbsp;&nbsp;vtkSmartPointer&lt;vtkRenderer&gt; ren = vtkSmartPointer&lt;vtkRenderer&gt;::New();</div>

<div>&nbsp;&nbsp;w.GetRenderWindow()-&gt;AddRenderer(ren);</div><div>&nbsp;&nbsp;vtkRenderWindowInteractor* iren = w.GetInteractor();</div><div>&nbsp;&nbsp;vtkSmartPointer&lt;vtkBorderWidget&gt; border = vtkSmartPointer&lt;vtkBorderWidget&gt;::New();</div>

<div>&nbsp;&nbsp;border-&gt;SetInteractor(iren);</div><div>&nbsp;&nbsp;border-&gt;SetResizable(1);</div><div>&nbsp;&nbsp;border-&gt;On();</div><div>&nbsp;&nbsp;w.show();</div><div>&nbsp;&nbsp;return app.exec();</div><div>}</div><div><br></div></div><div><br></div><div>Clint</div>

<div></div></div></div></blockquote></div><br><div>Strange... that works for me too. What isn't working is that same code but using a QVTKWidget that is on a form made in the Qt Designer (so instantiated from a .ui file).</div>

<div><br></div><div><div><br></div><div>&nbsp;&nbsp;vtkSmartPointer&lt;vtkRenderer&gt; rightRenderer =&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;vtkSmartPointer&lt;vtkRenderer&gt;::New();</div><div><br></div><div>&nbsp;&nbsp;// Add Actor to renderer</div><div>&nbsp;&nbsp;rightRenderer-&gt;AddActor(cubeActor);</div>

<div><br></div><div>&nbsp;&nbsp;// VTK/Qt wedded</div><div>&nbsp;&nbsp;this-&gt;ui-&gt;qvtkWidgetRight-&gt;GetRenderWindow()-&gt;AddRenderer(rightRenderer);</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;//add a border widget to the right renderer</div><div>&nbsp;&nbsp;vtkSmartPointer&lt;vtkBorderWidget&gt; borderWidget =&nbsp;</div>

<div>&nbsp;&nbsp; &nbsp; &nbsp;vtkSmartPointer&lt;vtkBorderWidget&gt;::New();</div><div>&nbsp;&nbsp;borderWidget-&gt;SetInteractor(this-&gt;ui-&gt;qvtkWidgetRight-&gt;GetInteractor());</div><div>&nbsp;&nbsp;borderWidget-&gt;On();</div><div><br></div><div>The cube shows up, so the renderer is setup correctly, but still no border widget ??</div>

<div><br></div><div>Here is the complete example:</div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Qt/BorderWidget">http://www.vtk.org/Wiki/VTK/Examples/Qt/BorderWidget</a></div><div><br></div><div>Maybe there is something wrong with the .ui file? It seems like everything is ok though since it compiles and I can interact with the cube...</div></div></blockquote><div><br></div><div><br></div><div>That is because you're deleting the border widget at the end of the SimpleView constructor. &nbsp;In other words, the smart pointer is going out of scope.</div><div><br></div><div>Clint</div><div><br></div></div></body></html>