[vtkusers] Using QVTKWidget
Joey Mukherjee
joey at swri.edu
Thu Apr 28 14:26:42 EDT 2005
Ok, I figured out my problem. I was foolishly setting the DisplayId
which I need for Motif. ifdef'ing those out made the program work
correctly.
Two comments:
1) Setting the size of my render window and then setting the
QVTKWidget's render window to my render window causes the size
information to be lost. Possibly this is by design, but I feel like
doing a _renWin->SetSize (600, 600); should make my QVTKWindow 600 x
600. Right now I also have a setMinimumSize.
2) Maybe the show/exec could be encapsulated in an Enable call so it
would be more like a RenderWindowInteractor.
My current code is:
#ifdef _QT_
_qvtk = new QVTKWidget ();
_qvtk->setMinimumSize (600, 600);
_qvtk->SetRenderWindow (_renWin);
_qvtk->show ();
#endif
Everything looks good to me!
Thanks to all who responded!
Joey
On Apr 27, 2005, at 3:36 PM, Clinton Stimpson wrote:
>> As you can see, I do exactly that. However, the window now pops up,
>> but there is nothing in it. It is like the window is not receiving
>> any events since I can resize the window and the window seems to take
>> on the "image" of the windows behind it or my background. This is on
>> Solaris 9. I wonder if this is some sort of GL problem...
>>
>> Any ideas?
>
> I have two ideas, both of which lead to the visual behavior you are
> seeing.
> 1. Make sure you add a vtkRenderer to the vtkRenderWindow so it can at
> least draw something.
> 2. Make sure the Qt event loop is started ( qApp->exec() ). On X11,
> you can still resize the window even if the event loop isn't started.
Joey
More information about the vtkusers
mailing list