I have a QGLWidget which is both 3D and 2D graphics (just like the bus) Pulls Talking about this thing after attracting PaintEvent (), etc. from 2D graphics (PentAg to PaintEug), the widget repeated most of the time. After loading it, after saving again, and did not do reddo. So I put the code Paint () , it helps in some cases, but helps eg. Resize shape
Then which function should I use to refresh the widget? Is it update () or updateGL () or repaint () ? Or it may be that there is a way to set some mode to enable automatic readings after resizing / loading. <<< / p>
Thank you.
You should generally use 'update' because it will allow you to create multiple queue events In the same event, the 'collapse' update method will call the updateGL for QGLWidgets. If you want to paint an instant, then the 'Paint' method should be used.
If you bowl a timer to make an 'update' call from time to time, then the failure to paint regularly is usually indicating that you are putting stress on the CPU.
Posting some code can be easy to understand problems with resizing / initialization.
Comments
Post a Comment