These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
A C++ source file containing just #include <LibFoo/Bar.h> should always compile cleanly. This patch adds missing header inclusions that could have caused weird error messages if they were used in a different context. Also, this confused QtCreator.