Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When is QGLWidget's paintGL called?

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

When is that, specifically?

like image 269
Nomis Raserf Avatar asked Jul 17 '13 21:07

Nomis Raserf


1 Answers

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! :-)

like image 190
peppe Avatar answered Oct 29 '22 02:10

peppe