Generated files for core component (com_trolltech_qt_core/ folder) contain #include "qwidget.h" and other similar includes that are not part of the core module.
Probably, this is an issue with typsystem_core.xml, that has type declarations for QTextDocument and other types/enums from QtGui.