Nominate our 2022 Qt Champions!

How to enforce vertical synchronisation with the new Qt5 OpenGL API

  • Typical OpenGL applications can enforce vsync (sync to video blank / vblank) to avoid screen tearing, using some window server specific extensions. The "swap_control" extensions does the trick, providing some platform specific function calls: glxSwapIntervalEXT on Linux X11 or wglSwapIntervalEXT on Windows, as stated by "OpenGL Official Wiki":

    Qt5 offers an new method to acquire an OpenGL context. This method is well described by the "OpenGL Window example": . However, using the new API of Qt GUI, it doesn't seem possible to enforce vsync using a swapInterval(1) call. The example suggests that the user must set the option in their video card driver configurations. Although, this is not acceptable for me.

    How should we enforce vsync with the new Qt5 QtGui OpenGL flavor?

    Thank you,

  • Indeed this looks to be missing. Please file a feature request at

    As a work around you will need to call the appropriate wgl/glx function yourself I'm afraid.

  • Already filed and resolved :) QTBUG-31770

    Planned for Qt 5.3.0 release!

Log in to reply