When an opengl widget is laid out, it will adjust the glViewport for you automatically. Keep in mind that events like mouse coordinates are still relative to your size.
See Implementation
When an opengl widget is laid out, it will adjust the glViewport for you automatically. Keep in mind that events like mouse coordinates are still relative to your size.