[Development] Use what you include mapping file
Scott Bloom
scott at towel42.com
Mon Oct 13 19:14:06 CEST 2025
As part of a pre-checkin "semi-lint" strategy (along with proper formatting etc), I am investigating the usage of the tool include-what-you-use.
https://github.com/include-what-you-use/include-what-you-use
Essentially, it confirms that both every source (and header) file includes every header directly to reduce the possibility of a compile break if a dependent header changes what it includes.
It also reports when you include something that you don't need, reducing compile time and dependencies.
It supports mapping files, for when a file is intentionally supposed to be included transitively. For instance, including <iostream> vs <iosfwd> will not report issues.
The problem is with Qt, every include is transitive. You include <QComboBox> not <qcombobox.h> for instance.
Creating this mapping file by hand, as you could imagine would be unlikely to be complete (or correct).
My question, does this mapping file already exist somewhere? If so where?
If not, would this be something that would ever be considered? To be frank, I don't want to bother with the enhancement request if it will just sit in the dustbin of issues of low priority.
Thanks.
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20251013/3993dce2/attachment.htm>
More information about the Development
mailing list