When is QGLWidget's paintGL called?

吃可爱长大的小学妹 提交于 2019-12-29 07:32:12

问题


All I can find is "whenever the widget needs to be painted."

When is that, specifically?


回答1:


When you call updateGL() on your widget (or update()), or just Qt decides to redraw your widget. Reasons why Qt might choose to ask for a redraw include:

  • your widget gets resized
  • your widget is hidden and shown again
  • your widget is minimized and then restored
  • something else is put in front of your widget and then moved away
  • the Moon is in the third quarter
  • a distant butterfly had flapped its wings
  • ...

In short, you have very little control about when Qt asks for a repaint. Just be sure to paint fast! :-)



来源:https://stackoverflow.com/questions/17710514/when-is-qglwidgets-paintgl-called

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