Improve the handling of Qt5 modules in the build system