sintegrial/qwtplot3d

Base class QGLWidget is now deprectated causing weird behaviour

calogeromauceri opened this issue · 4 comments

Hi all,

we've been using this library in our projects and it has been working greatly.
Unfortunately after upgrading our application from Qt 5.9 to 5.12, the widget where the plot should be is not properly rendered anymore, it is completely blank. We think it is an issue caused by the base class the plots derive from, QGLWidget. That class has been deprecated and it is not supported anymore. New applications are encouraged to use the new class QOpenGLWidget.
As a matter of fact we modified the library to use the new class and the applications is now working as expected.

The new modified library is available here
https://github.com/calogeromauceri/qwtplot3d/tree/port_to_qopenglwidget

The library is working in our use cases, but some examples are not working anymore. More work is needed to finalize it, but we do not have enough resources to allocate to this. For that reason the new code is there for whoever wants to contribute.

We will send a "pull request" to merge our changes to the original project, hoping this can help in keeping this lib alive and useful.

Link to the pull request
#15

I can compile and run all the stuff in ./example directory from commit d80c9088 just fine with Qt 5.12.6.

When you said "some examples are not working anymore", what are those? I think it is more related to OpenGL rendering mechanism particular to your Qt build rather than library version compatibility.

We noticed the 3D plots rendering issues when the plot is in a secondary dialog. For example from the main application you open a dialog with the 3D plot in it. The first time the dialog is opened the plot is properly rendered. The second time it is completely blank. We do not have those kind of problems with the version we modified replacing deprecated class QGLWidget with QOpenGLWidget.

I found the problem is still present using qt5-11 on fedora box with using last master version from sintegrial which uses QOpenGLWidget as replacement of QGLWidget. The first plot is blank, while the second one is correct. By replacing QOpenGLWidget again with QGLWidget in this last version, the first plot is correct, but there is a problem when detaching plot window and try to re-attach it to the main window.