How to fix tearing in Qt Quick app with Qt 5.9.1?

502 views Asked by At

My app is having tearing problems when I scroll fast horizontally. Normally I'd just enable vsync, but I don't know how to do that in Qt. The tearing is occurring on my dev PC which runs Linux with a X-server, but it will also need to work well on the target system which is either Android or Linux+EGLFS.

One google result was from the Qt4 era and said that the tearing will be gone in Qt 5. But apparently it isn't.

Many google results are about env vars for embedded linux systems, such as QT_QPA_EGLFS_FORCEVSYNC, but I'd prefer the solution to work for my dev PC as well.

One google result said that vsync being enabled/disabled depends on the renderloop in use. I don't override the renderloop, so, since I'm on linux, I think I'm using the threaded renderloop.

1

There are 1 answers

0
Stefan Monov On

Here's a bugreport about nvidia binary drivers causing this.

https://bugreports.qt.io/browse/QTBUG-45480

I too am using those drivers, so this may be it - just a driver bug. If so, at least it's unlikely to happen on my target hardware (I still haven't tested there), so that's good.