Than this worked by accident, qmake requires to know which modules to use for both the include paths and the libraries to link to and "widgets" is required for QtWidgets since 5.0.
Adding "widgets" is one of the things that need to be done when porting from Qt4 to Qt5, as QtWidgets was split from QtGui into its own module.
No, I think it only detects the sources and headers.
Then it might be worth considering always using the same build system or using something that can generate input for all required build systems.
E.g. qmake can not only generate Makefiles, it can also generate visual studio project files.
CMake has even more output generators.
Cheers,
_
Bookmarks