<div dir="ltr">QVTKWidget provides you a vtkRenderWindow. You add your renderers by qvtkWidget-&gt;GetRenderWindow()-~&gt;AddRenderer(your renderer).<br><br><br>Have a look here<br><br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx#Qt">http://www.vtk.org/Wiki/VTK/Examples/Cxx#Qt</a><br>
<br>Jothy<br><br><br><div class="gmail_quote">On Tue, May 15, 2012 at 9:11 PM, Massi <span dir="ltr">&lt;<a href="mailto:Massinissa.Bandou@usherbrooke.ca" target="_blank">Massinissa.Bandou@usherbrooke.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
I&#39;m new on Qt and I want to display a JPEG image on my Qt interface. I know<br>
I have to use QVTKWidget but I have no idea how it works? Here is a basic<br>
code for reading a jpeg:<br>
<br>
#include &quot;CoregistrationForm.h&quot;<br>
<br>
int main(int argc, char *argv[])<br>
{<br>
      QApplication app(argc, argv);<br>
      vtkJPEGReader *jpegReader = vtkJPEGReader::New();<br>
<br>
jpegReader-&gt;SetFileName(&quot;/Users/Massi/Desktop/bin_myProject/Release/test.jpg&quot;);<br>
      jpegReader-&gt;Update();<br>
<br>
      vtkImageMapper *imageMapper =vtkImageMapper::New();<br>
      imageMapper-&gt;SetInput(jpegReader-&gt;GetOutput());<br>
      imageMapper-&gt;GetInput();<br>
<br>
      vtkImageActor *mapActor= vtkImageActor::New();<br>
      mapActor-&gt;SetInput(imageMapper-&gt;GetInput());<br>
      vtkRenderer *ren=vtkRenderer::New();<br>
      ren-&gt;AddActor(mapActor);<br>
      ren-&gt;ResetCamera();<br>
      ren-&gt;GetRenderWindow()-&gt;Render();<br>
<br>
      QVTKWidget *vtkWidget;<br>
      .....<br>
      ....????<br>
<br>
}<br>
<br>
my CoregistrationForm.h contains<br>
<br>
class CoregistrationForm : public QDialog {<br>
    Q_OBJECT<br>
public:<br>
    CoregistrationForm();<br>
    virtual ~CoregistrationForm();<br>
public slots:<br>
<br>
public:<br>
    Ui::CoregistrationForm widget;<br>
};<br>
<br>
Massi<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/use-QVTKWidget-tp5710369.html" target="_blank">http://vtk.1045678.n5.nabble.com/use-QVTKWidget-tp5710369.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<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>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>