[vtkusers] Using VTK widgets in Qt renderers

Wagner Sales wsales at gmail.com
Mon Feb 8 16:22:25 EST 2010


Hi David,

I  didn't the test with to renderers. Can you post the entirely code?
Of course, if you don't have problems to do this. I'll try to test.

Wagnre

2010/2/8 David Doria <daviddoria+vtk at gmail.com>:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list