[vtkusers] Question about the QT GUI Events example

Benjamin Sobotta mayday at gmx.net
Mon Jul 16 09:13:35 EDT 2007


> Hi
> 
> I need to use QT in a project along with vtk and I compiled the vtk
> with gui support, and I have mad some stupied examples. But then I
> looked at the Events example that are in the
> QTDIR/Examples/GUI/QT/Events
> Now this might be a Qt Designer question but I think that you know
> this because it is tied to the QVTKWidget.
> When I look in the file GUI.h the function init() there is a pointer
> called ren1,
> 
> ren1 = vtkRenderer::New();
> 
> now this is not created before it is used, so this got me curious, so
> I looked in the GUI.ui file and found
> 
> <includes>
>     <include location="local" impldecl="in
> implementation">vtkRenderer.h</include>
>     <include location="local" impldecl="in
> implementation">vtkRenderWindow.h</include>
>     <include location="local" impldecl="in
> implementation">vtkEventQtSlotConnect.h</include>
>     <include location="local" impldecl="in
> implementation">QVTKWidget.h</include>
>     <include location="local" impldecl="in
> implementation">GUI.ui.h</include>
> </includes>
> <forwards>
>     <forward>class vtkRenderer;</forward>
>     <forward>class vtkEventQtSlotConnect;</forward>
>     <forward>class vtkObject;</forward>
>     <forward>class vtkCommand;</forward>
> </forwards>
> <variables>
>     <variable>vtkRenderer* ren1;</variable>
>     <variable>vtkRenderer* ren2;</variable>
>     <variable>vtkEventQtSlotConnect* connections;</variable>
> </variables>
> 
> and my question is where in QT Designer do I add these includes,
> classes and variables? I am using QT version 4.3.0
> (if there exist an homepage/manual where this is explained please
> point me to that one, I have tried to find information in the Qt
> Designer manual, but can find anything.)
> 
> best regards
> Anders

Hi!

You can set member variables of your GUI in the "Object Explorer". Most likely it's one of the windows on the right side of designer. There you change to tab "Members" and you'll find ren1 and ren2 under "Class Variables" -> "protected".

HTH,

Benjamin



More information about the vtkusers mailing list