The box example This example program shows how to use OpenGL in Qt: Put your OpenGL code in a class inherited from TQGLWidget. The resulting subclass may be used like any other TQt widget, with signals and slots, geometry management, etc..