[vtkusers] How to put Qt widgets on top of a VTK OpenGL scene

Clinton Stimpson clinton at elemtech.com
Wed Oct 15 12:23:35 EDT 2008


The solution is to implement a QPaintEngine for the QVTKWidget.  Then  
its almost a drop-in replacement for QGLWidget in those examples  
you're looking at.

This has been discussed before, and here's the end of that last thread.
http://www.vtk.org/pipermail/vtkusers/2008-August/096696.html
There's some rudimentary sample code included that demonstrates what  
you're after.

The sample code needs to be improved before it can be included into  
VTK, and preferably without calling OpenGL directly.  Hopefully VTK  
has enough abstract apis to make that possible.  I'd work on it some  
more, but haven't got the resources to.

Clint

On Oct 15, 2008, at 10:00 AM, vtkusers-request at vtk.org wrote:

> Hi,
>          Qt-4.4.3 has recently added support for rendering Qt widgets
> on top of a VTK OpenGL scene. I just downloaded the latest release of
> Qt-4.4.3 and tried it on Mac OS X 10.5.5 and the demo application
> works well, without any problems.
>
> I want to be able to use Qt to render a VTK OpenGL scene, as well as
> utilize this new capability to directly render Qt widgets within the
> VTK rendered OpenGL scene. This will raise the bar for interactive
> applications developed using Qt.
>
> I took a quick look at the QVTKWidget plugin for QtDesigner. It
> subclasses from QtWidget.
>
> The functionality outline above requires that you subclass from
> QtGraphicsView.
>
> I was just wondering if someone who know the QVTKWidget plugin can
> tell me of the implementation used for creating QVTKWidget plugin are
> compatible, i.e. QtWidget can use QtGraphicsView or we can get an
> instance of QtGraphicsView from QtWidget, and use the technique
> outlined in the article below to render Qt Widgets directly into a VTK
> OpenGL scene.  Or  if we need to re-write QVTKPlugin to support this
> capability?
>
> Here is a link to the article and a blog
>
> Accelerate your Widgets with OpenGL
>
> Qt Labs Blogs ? Accelerate your widgets with OpenGL
>
> as well as a screenshot
>
>
>
> The sample code can be downloaded using the following command
>
> svn checkout svn://labs.trolltech.com/svn/graphics/dojo/modelviewer
>
> Best regards,
>
> Elvis Dowson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081015/9dcd0ad6/attachment.htm>


More information about the vtkusers mailing list