How can QOpenGLWidget update not result in paintGL events?

自古美人都是妖i 提交于 2019-12-03 22:11:10

问题


I'm logging calls to update() and paintGL(), but somehow, only update happens. paintGL is called a couple of times and then never again! How is this possible? The window is visible and isVisible() returns True every time update() is called.

Specifically, I converted from QGLWidget to QOpenGLWidget. I replaced my calls to updateGL() with calls to update(), and I replaced passing the format to the constructor with calling setFormat(). I added various calls to makeCurrent() where appropriate. Is there anything I'm missing?

It appears that QOpenGLWidget might be broken when it is one of many widgets within a window.


回答1:


My QOpenGLWidget was in a QScrollArea, which was not forwarding QPaint events.



来源:https://stackoverflow.com/questions/30748991/how-can-qopenglwidget-update-not-result-in-paintgl-events

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!