[vtkusers] Using VTK widgets in Qt renderers

David Doria daviddoria+vtk at gmail.com
Mon Feb 8 16:15:26 EST 2010


On Mon, Feb 8, 2010 at 3:24 PM, Wagner Sales <wsales at gmail.com> wrote:

> Hi David,
>
> May be you are forgiving the interactor. The following code works fine
> to me ( are in a widget constructor ):
>
>        Widget = new QVTKWidget(this);
>        WidgetLayout->addWidget(Widget); // my layout
>        vtkRenderWindowInteractor *Inter = Widget->GetInteractor();
>        Inter->SetRenderWindow(Widget->GetRenderWindow()); // <------
> may be this are your problem?
>
>        vtkRenderer *ren = vtkRenderer::New();
>        Connector = vtkEventQtSlotConnect::New();
>        // connects the interactor to default slots
>
>       // some connections I need. you not are asking for this, but I
> think can useful
>        Connector->Connect(Inter,
>
> vtkCommand::LeftButtonPressEvent,this,SLOT(OnMouseLeftPressedEvent(vtkObject*)));
>        Connector->Connect(Inter,
>
> vtkCommand::LeftButtonReleaseEvent,this,SLOT(OnMouseLeftReleasedEvent(vtkObject*)));
>
>        Widget->GetRenderWindow()->AddRenderer(ren);
>        ren->Delete();
>
> Regards,
>
> Wagner
>
>
Hmm, I thought that would be automatically setup? I added it anyway, but
still the border widget does not appear :(

You really got the whole thing with two renderers in Qt to show the border
widget??

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100208/a38915fd/attachment.htm>


More information about the vtkusers mailing list