Important: Please read the Qt Code of Conduct -

If VSync on refresh rate divided between QGLWidgets

  • Hi,
    I need many QGLWidget subclass instances, lets say up to 16 so far, in my application on which is being painted video. No mater If I set swap interval with setSwapInterval() to 0 or 1, the VSync is always on unless turned off with nvidia-settings before start of my application. Now the problem is the refresh rate isn't 60 fps on each QGLWidget, but is divided between them. That means when running one QGLWidget at time its refreshed with 60 fps, two are refreshed with 30 fps each, four with 15 each and so on. So when running 16 QGLWidgets refresh is 3.75 fps and that really sucks. The graphics card is not the bottleneck, because its loaded up to 10% and almost no traffic on bus.

    On the other hand when VSync is turned off in nvidia-settings each QGLWidget is refreshed with 60 fps, but the video is tearing heavily.

    Have anyone experienced the same weird behaviour?

    Thanks for any suggestions!

    Ubuntu 13.10
    Qt 5.2
    Nvidia NVS 510/PCIe

  • Hi,

    I have no experience with it. But what you described brought to mind (kind of) what I wasted my own day with. And maybe this helps:

    Have you tried using the OpenGL graphicsystem for all of Qt (not just the QGLWidgets? This can be accomplished my passing -graphicsystem opengl as command line arguments. Alternatively there is a way to accomplish the same by a call of a QApplication method which I can't recall right now.

    I'm not sure if it helps, but what you describe sounds as if the frames where distributed between the QGLWidgets. So having OpenGL render all of it anyway might help. So really just a suggestion.


  • Hi,
    do you mean QApplication::setGraphicsSystem? If so, its deprecated and no longer available.

    But anyway thanks for reply!

  • Yupp, that's what I meant. Sorry, didn't read that you were using Qt5.

    Edit: Anyway is there no way to get OpenGL rendering for the entire application in Qt5?!? I haven't worked with it so far.

Log in to reply