On Ubuntu 16.04 and 18.04 it is not possible to get Qt 5.12 from the official repo. You will need to get it from https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.12.2-bionic which places the files in /opt. This leads qmake to including the files as non system headers, which makes them spam errors. Adding them as -isystem headers first prevents this.