[Development] On ensuring that private headers include at least one other

Thiago Macieira thiago.macieira at intel.com
Tue Jun 24 16:08:26 CEST 2025


On Monday, 23 June 2025 22:56:37 Pacific Daylight Time Sze Howe Koh wrote:
> A few years ago, our private headers were updated to include
> qglobal_p.h. Examples:
> * https://codereview.qt-project.org/c/qt/qtbase/+/121135
> * https://codereview.qt-project.org/c/qt/qtdeclarative/+/395249
> 
> The commit messages say, "See script in qtbase/util/includeprivate for
> the rules", but I wasn't able to find this script.
> 
> 1. What's the rationale for #include-ing private headers like this?

The reason is https://codereview.qt-project.org/c/qt/qtbase/+/126851

That will mark anyone who even includes a private header as "I'm using private 
API", whether you made function calls or not. That is deferred, meaning I plan 
on resurrecting at some point in the future. It's been part of my build of Qt 
for nearly 10 years.

> 2. Is a copy of the script published somewhere? Should the script be
> pushed to qtbase/util/includeprivate as advertised?

https://codereview.qt-project.org/c/qt/qtbase/+/395221

> 3. Should the rules be enshrined in a QUIP, and/or should the Sanity
> Bot be given a new job?

syncqt.pl used to complain about this. That's how I found and fixed the misses 
back in the day. That has probably been lost since the conversion to C++, 
because like the other changes it wasn't actually merged.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5150 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20250624/35ed29d5/attachment.bin>


More information about the Development mailing list