[vtkusers] Question about the QT GUI Events example

Anders Sandholm anders.sandholm at gmail.com
Mon Jul 16 11:12:29 EDT 2007


Hi

This might be old news, but QT has change a lot in QT 4, and how the
designer workes. More info can be found at
http://doc.trolltech.com/4.2/porting4-designer.html


// anders


On 7/16/07, Anders Sandholm <anders.sandholm at gmail.com> wrote:
>
> Hi
>
> just realized another thing, when I open the .ui file in QT Designer
> 4.3 it says
>
> "This file was created using Designer from QT-3.3 and will be
> converted to a new format by QT Designer.
> The old for has been untouched..."
>
> and if I open the (converted and saved) ui file in a text editor the
> includes, forwards and variables has been removed.
>
> Is anybody using this method or should I just create my form and then
> create an class that inherit from the "ui" class and my new class add
> the objects that I need.
>
> Anybody using QT Designer 4.3? I have used 3.x before and it seams
> that a lot has been changed.
>
> Any ideas anybody?
>
> best regards
> // anders
>
>
> On 7/16/07, Benjamin Sobotta <mayday at gmx.net> wrote:
> > > 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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070716/c272150d/attachment.htm>


More information about the vtkusers mailing list