[vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2

Mathieu Westphal mathieu.westphal at kitware.com
Tue Sep 18 04:10:26 EDT 2018


Hi Leonid, Hi Andras,

QVTKWidget and QVTKWidget2 are deprecated and should not be used, at least
not if you have any problem with them in your application.

VTK < 9, QVTKOpenGLWidget should be used
VTK >= 9, QVTKOpenGLWidget has been renamed QVTKOpenGLNativeWidget (so it
is not recently added) and should be used when needing a native widget
a new QVTKOpenGLWidget has been added and should be used for all other
usecases.

for QVTKOpenGL*Widget, you can find example in VTK/GUISupport/Qt/Testing/Cxx

Best regards,

*For reference, see the mail sent on 2018 Aug 23, "The new
QVTKOpenGLWidget"*

*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 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 :*


   1. *Your Qt application only uses a central QVTKOpenGLWidget for
      rendering:*
      2. *-> Nothing to do, just build with last master and make sure all
      is working well*
      3. *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.*
      4. * -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget
      and you are good to go*
      5. *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) : *
      6. * -> 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
<https://gitlab.kitware.com/vtk/vtk>.*

*Best regards,*

*Mathieu Westphal*




Mathieu Westphal

On Tue, Sep 18, 2018 at 7:27 AM, Leonid Dulman via vtkusers <
vtkusers at public.kitware.com> wrote:

> Hi to all
> I have problems to use QVTKOpenglWidget  vs QVTKWidget2
> If somebody have a simple example how to use  QVTKOpenglWidget instead of
>  QVTKWidget2
> Thanks, Leonid
>
>
> ------------------------------
> *From:* Andras Lasso <lasso at queensu.ca>
> *To:* minjun <mey1k at naver.com>; "vtkusers at vtk.org" <vtkusers at vtk.org>
> *Sent:* Tuesday, September 18, 2018 5:43 AM
> *Subject:* Re: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2
>
> You may try the recently added QVTKOpenGLNativeWidget instead.
>
> https://www.vtk.org/doc/nightly/html/classQVTKOpenGLNativeWidget.html
>
> Let us know if it works for this use case.
>
> Andras
>
> -----Original Message-----
> From: vtkusers <vtkusers-bounces at public.kitware.com> On Behalf Of minjun
> Sent: Monday, September 17, 2018 8:55 PM
> To: vtkusers at vtk.org
> Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2
>
> I want to have qvtkwidget as background and place a generic QWidget on top
> of it.
>
> However, when I place a generic qwidget, the widget looks like to stop or
> not work properly.
>
> I came to know through many searches that this is a opengl context problem.
>
> So some people advice me to use QWidget2 or QVTKOpenglWidget to solve this
> problem.
>
> Is this the right way?
>
> If you have any experience like this, I would like to get some advice.
> Thank you.
>
>
>
> --
> Sent from: https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-
> f1224199.html&data=02%7C01%7Classo%40queensu.ca%
> 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b
> 925c%7C1%7C0%7C636728289083872456&sdata=6B8JqvIzktn4XNu3v18rNcJyhxhZDY
> y26Gwof34s4xM%3D&reserved=0
> _______________________________________________
> Powered by https://na01.safelinks.protection.outlook.com/?url=
> www.kitware.com&data=02%7C01%7Classo%40queensu.ca%
> 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b
> 925c%7C1%7C0%7C636728289083872456&sdata=AkgZvzAL7n8armZ8649xepsg%2Buj%
> 2BMil3frU6J3S9bRs%3D&reserved=0
>
> Visit other Kitware open-source projects at https://na01.safelinks.
> protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%
> 2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%
> 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b
> 925c%7C1%7C0%7C636728289083872456&sdata=W2ZVY9Q66kNWrbfoaonUGqUcV3sOkJ
> J3SkSpt6S%2FkIQ%3D&reserved=0
>
> Please keep messages on-topic and check the VTK FAQ at:
> https://na01.safelinks.protection.outlook.com/?url=
> http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%
> 7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%
> 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata=
> 5ykO5UWnOawjKVcuB4Y0gj4f1G1oCtrUNXI%2FWfTyP8U%3D&reserved=0
>
> Search the list archives at: https://na01.safelinks.
> protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%
> 2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%
> 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b
> 925c%7C1%7C0%7C636728289083882461&sdata=Fa0SmWYAebDG5IDvFcWpXrbRD3vFBy
> sxPUJ2nMuh9Xs%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%
> 2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%
> 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b
> 925c%7C1%7C0%7C636728289083882461&sdata=fY1lu2ueycUk5r1TNSq%
> 2FP0W733wkfT4vKf99LPe4KzY%3D&reserved=0
>
> _______________________________________________
> 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
>
>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180918/9104b8ac/attachment.html>


More information about the vtkusers mailing list