[Development] Use what you include mapping file

Scott Bloom scott at towel42.com
Tue Oct 14 18:34:26 CEST 2025



-----Original Message-----
From: Development <development-bounces at qt-project.org> On Behalf Of David Redondo via Development
Sent: Tuesday, October 14, 2025 00:19
To: development at qt-project.org
Subject: Re: [Development] Use what you include mapping file

Am Montag, 13. Oktober 2025, 19:14 schrieb Scott Bloom:
> 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.
> 

We have these pragmas 

➜ /usr/include/x86_64-linux-gnu/qt6/QtWidgets cat QComboBox #include "qcombobox.h" // IWYU pragma: export

do these  not help the tool? Why is a separate mapping file needed?

David

==========
Where is this located on windows?

Scott


More information about the Development mailing list