Don't compile the QT parts of this library if we cannot find the relevant
QT headers.
Spread some more const.