[vtkusers] the New QVTKOpenGLWidget

Elvis Stansvik elvis.stansvik at orexplore.com
Mon Sep 24 04:01:26 EDT 2018


Thanks for digging this up Mathieu. Would have been nice if Qt
documented which situations will force native somewhere.

We have another VTK widget in a QScrollArea at one place, so there
we'll have to use the old one. But good to know QTabWidget can hold
the new one.

Elvis
Den mån 24 sep. 2018 kl 09:38 skrev Mathieu Westphal
<mathieu.westphal at kitware.com>:
>
> Hi Elvis,
>
> This is down to Qt developpers only, see this 2013 change :
> https://codereview.qt-project.org/#/c/68683/
> And associated code :
> https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwindowcontainer.cpp.html#101
>
> QTabWidget will never force it to be a native widget though and even if it was, you will be informed as we do put a QVTKOpenGLWidget in a QTabWidget in ParaView.
> My Advice is to use the new QVTKOpenGLWidget in your case.
>
> Best regards,
>
> Mathieu Westphal
>
>
> On Fri, Sep 21, 2018 at 6:48 PM Elvis Stansvik <elvis.stansvik at orexplore.com> wrote:
>>
>> Den tors 23 aug. 2018 11:09Mathieu Westphal <mathieu.westphal at kitware.com> skrev:
>>>
>>> Hello list,
>>>
>>> If you are working on a VTK/Qt application this information should interest you.
>>> Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, while the old one has been moved to QVTKOpenGLSimpleWidget.
>>> The last fixes for this change have just been merged, so make sure to use VTK master to test this.
>>>
>>> 1. Why is there a new widget and what does it do ?
>>> We have been having some issues reported for the old widget, and the old widget could not support quad buffer stereo rendering by design.
>>> Has it is a needed feature in ParaView, a reimplementation was necessary. This new widget fix most of the reported issues with the old widget as well as adding stereo support.
>>>
>>> 2. Why keeping the old widget around then ?
>>> Due to Qt limitations, this new implementation does not support very well being a native widget.
>>> But native widget are sometimes mandatory, for example within QScrollArea and QMDIArea, so the
>>
>>
>> Do you know what other containers apart from QScrollArea will require native widget? Will QTabWidget?
>>
>> Asking because we are planning to possibly put one of our VTK views in a tab widget, but would really like to benefit from some of the improvements in the new VTK widget (respect for fractional device pixel ratio mostly).
>>
>> If tab widget will require native, then I should really brush up an old MR of mine that fixes fractional device pixel ratio in the "old" native widget. I should do this anyway of course, but now I've heard that 8.2 might be around the corner, making it more urgent to do that asap.
>>
>> Elvis
>>
>>> QVTKOpenGLSimpleWidget should be used when in needs of VTK rendering in the contact of Qt native widget.
>>>
>>> Also it allows users to switch back to the old widget if necessary.
>>>
>>> 3. I'm not sure what native widgets are, what should I do in my application ?
>>>
>>> Here are the different situation :
>>>
>>> Your Qt application only uses a central QVTKOpenGLWidget for rendering:
>>> -> Nothing to do, just build with last master and make sure all is working well
>>> Your Qt application only uses QVTKOpenGLWidget within QScrollArea or QMDIArea, or manually set widgets to be native and you are not interested by stereo rendering.
>>>  -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you are good to go
>>> Your application uses a non-native QVTKOpenGLWidget for rendering as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the central rendering widget and the color map editor rendering widget in scroll areas) :
>>>  -> Use QVTKOpenGLWidget for non-native widgets and QVTKOpenGLSimpleWidget for native ones. The later will never support stereo.
>>>
>>>
>>> 4. I followed your recommendation but I see some strange stuff/bugs/rendering issues
>>> Even if this new class has been tested extensively and will be used in the next ParaView release, It may still contains some issues. Feel free to discuss them in this mailing list or on our gitlab.
>>>
>>> Best regards,
>>>
>>> Mathieu Westphal
>>> _______________________________________________
>>> 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:
>>> https://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list