[vtkusers] Crashed when I used a QVTKWidget to render two vtkRenderWindow in turn

Shawn Waldon shawn.waldon at kitware.com
Thu Aug 18 11:09:58 EDT 2016


Hi Sophonet,

It has been discussed here before that there are known issues with
QVTKWidget and Qt 5.X.  QVTKWidget is using the QWidget parent to get a
window and then directly using window system calls for your OS to get an
OpenGL context.  This is not the way Qt expects OpenGL-based widgets to act
(and Qt knows nothing about the fact that it is an OpenGL-based widget) and
so there are problems.  (Especially if you are using the new OpenGL2
rendering backend)  There are a few ideas floating around for how to do
this right with Qt 5.X, but to my knowledge no one has actually tackled
this and created a VTK widget that subclasses Qt's new QOpenGLWidget and
deals with all the corner cases needed for VTK rendering.  Search the
archives of this mailing list for QOpenGLWidget (or QVTKWidget) and you
should find the threads where this was discussed.  I think there were a few
workarounds discussed on those...

Sorry this isn't a more helpful response,
Shawn

On Thu, Aug 18, 2016 at 11:00 AM, Sophonet <vtk12af6bc42 at kant.sophonet.de>
wrote:

> Hi List,
>
> well, I can confirm that there are some problems with VTK7.0.0 and (on my
> system) QT 5.7.0.
>
> The problems occur when reparenting QVTKWidgets. I have written a small
> demo app, based on existing VTK examples, which shows the problem. It is
> attached to this e-mail.
>
> When reparenting (swapping) the two QVTKWidgets, the console window says
> "QWidget::repaint: Recursive repaint detected", and an error window pops up
> with "Invalid Pixel format, no OpenGL support".
>
> Obviously, for the attached demo app, there would be a solution without
> reparenting the windows - nevertheless, it seems like a bug and in another
> application, I need to reparent the widgets, which (due to this problem)
> forces me to keep using Qt 4.8.7, in which reparenting is working.
>
> Anybody can confirm the problem and propose a solution / workaround?
>
> Thanks,
>
>      Sophonet
>
>
>
> Am 2016-08-18 08:46, schrieb 박병준:
>
>> If you use QVTKWidget, it is recommended to make two QVTKWidget s.
>> You can show and hide each widget in QT very easily.
>> You don't need to switch two RenderWindow in on Widget with pain.
>>
>> Samuel Park.
>>
>>
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/Crashed-when-I-used-a-QVTKW
>> idget-to-render-two-vtkRenderWindow-in-turn-tp5739836p5739839.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160818/11e5e7c9/attachment.html>


More information about the vtkusers mailing list