If you need to call the standard OpenGL API functions from other places (e.g. Your widget's OpenGL rendering context is made current when paintGL(), resizeGL(), or initializeGL() is called. If you need to trigger a repaint from places other than paintGL() (a typical example is when using timers to animate scenes), you should call the widget's update() function to schedule an update. Gets called once before the first time resizeGL() or paintGL() is called. initializeGL() - Sets up the OpenGL resources and state.Gets called whenever the widget has been resized (and also when it is shown for the first time because all newly created widgets get a resize event automatically). resizeGL() - Sets up the OpenGL viewport, projection, etc.Gets called whenever the widget needs to be updated. QOpenGLWidget provides three convenient virtual functions that you can reimplement in your subclass to perform the typical OpenGL tasks: It is very simple to use: Make your class inherit from it and use the subclass like any other QWidget, except that you have the choice between using QPainter and standard OpenGL rendering commands. QOpenGLWidget provides functionality for displaying OpenGL graphics integrated into a Qt application.