[vtkusers] QVTKwidget block QT widgets

David Gobbi david.gobbi at gmail.com
Tue Nov 16 09:54:26 EST 2010


Any animation in VTK should be done with timers, and if you are using
Qt, the best thing is to use Qt timers for this.  Set up a Qt timer
that will update one frame of the animation, and then set the timer to
run at your desired frame rate.

As long as the animation is driven by timers, the animation and
interaction can be simultaneous.  I've done this myself with Qt.

  David

On Tue, Nov 16, 2010 at 7:45 AM, Clinton Stimpson <clinton at elemtech.com> wrote:
> On 11/16/2010 05:56 AM, Pelt, R.F.P. van wrote:
>
> Dear all,i
>
>
>
> For a while I have been using the QVTKwidget as main render frame in my
> applications.
>
> One drawback of the QVTKwidget is the blocking behavior during interaction
> with the renderwindow.
>
> QVTKWidget doesn't do blocking.  It behaves like any other QWidget when
> dealing with timers, event loops, and painting.
>
>
>
> For example:
>
> Currently I have an animation, based on the active position on a slider
> widget.
>
> If I ‘play’ the animation, the slider and the rendering gets updated by a
> timer.
>
> However, during interaction with the VTK renderwindow/camera, the QT
> behavior is blocked as well as the animation.
>
>
>
> Does anyone know how to overcome this issue? Is it possible to animate and
> interact simultaneously?
>
> It should be possible.  What happens if you increase the interval on the
> timer?
> I'm wondering if you're doing something like using a zero interval repeating
> timer and Qt is not giving any cycles to anything else.
>
> Clint



More information about the vtkusers mailing list