[vtkusers] QVTKWidget Good bye
minjun
mey1k at naver.com
Fri Sep 21 03:39:28 EDT 2018
hi,
I think many vtk beginners are having the same problem now.
Below are the problems I have experienced and the solutions to them.
Problem
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.
Solution
***
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 Lasso>
***
***
Second
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 :
« [hide part of quote]
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>
***
***<example>
https://stackoverflow.com/questions/46787783/vtk-examples-not-working-qvtkopenglwidget
***
***<result>
<http://vtk.1045678.n5.nabble.com/file/t342477/background.png>
***
I am so grateful to those who gave me this answer.
So I also post this message to help a little bit of someone's search time.
thank you.
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list