As the minimum build requirements are now Qt 5.9, enable the QT_DEPRECATED_SINCE
macro and set the deprecation target to 5.9 and earlier. This will make our build
fail if functions deprecated in Qt 5.9 or earlier are used.
Also, enable the QT_DEPRECATED_WARNINGS macro so our build system warns us when
we are using functions deprecated in newer versions of Qt so we can port away from
those too.
The old way to check for the Qt version was a bit of a hack
and not very flexible. For Qt 6, it was broken and produced
false positives.
This commit fixes this by replacing the check function with
a proper implementation imported from QtCreator's qmake files
and updates the minimum requirements to reflect the new situation.
Qmake by default creates lots of unnecessary information during builds
which makes it hard to extract warnings and errors from the log.
Add the undocumented silent parameter to make it less talky.