Transitioning from QGLWidget to QOpenGLWidget issue.
-
Folks,
We have updated a long running code base from QGLWidget to QOpenGLWidget, but we had some issues.
We open dialogs over the widget then close them again, the widget is not repainting where the dialog was.
Not looking at the code, I see we set to attributes: Qt::WA_PaintOnScreen and Qt::WA_NoSystemBackground. I suspect the Qt:WA_PaintOnScreen is part of the issue, but am not sure if it or the Qt::WA_NoSystemBackground actually are the problem.
Anyone have more info.
Dale
-
I have some additional information on the QOpenGLWidget side of things. When using QGLWidget, I see repaintEvents coming to the parent window, but when using QOpenGLWidget I do not see them, even when doing the same sequence of events. Not sure what that means, but it explains the lack of repaints.
Dale
-
I have some additional information on the QOpenGLWidget side of things. When using QGLWidget, I see repaintEvents coming to the parent window, but when using QOpenGLWidget I do not see them, even when doing the same sequence of events. Not sure what that means, but it explains the lack of repaints.
Dale
@DalePennington Did you implement https://doc.qt.io/qt-6/qopenglwidget.html#paintGL ?
-
The existing code (using QGLWidget) does not implement the paintGL function. This GL painting is handled internally by a third party library. I just replaces the QGLWidget with QOpenGLWidget, not other changes.
At this point I think the big issue is lack of repaintEvents. Is that somehow tied to the paintGL function ?
Dale
-
The existing code (using QGLWidget) does not implement the paintGL function. This GL painting is handled internally by a third party library. I just replaces the QGLWidget with QOpenGLWidget, not other changes.
At this point I think the big issue is lack of repaintEvents. Is that somehow tied to the paintGL function ?
Dale
@DalePennington said in Transitioning from QGLWidget to QOpenGLWidget issue.:
Is that somehow tied to the paintGL function ?
Yes, this is what you need to do if you want to use QOpenGLWidget - implement paintGL
-
I have gotten a new sample from the library vendor, and it does use paintGL. We were working off a sample from 12 years ago as our base and apparently they have updated a lot since then. I am trying to fit their new implementation in and see how it works.
Thanks for the feedback