[Development] Coding convention for private includes

Kevin Ottens kevin.ottens at kdab.com
Mon Jan 23 11:00:02 CET 2017


Hello,

On Friday, 20 January 2017 15:06:53 CET Thiago Macieira wrote:
> On sexta-feira, 20 de janeiro de 2017 14:55:00 PST Sean Harmer wrote:
> > Just a query about the coding convention around inclusion of private
> > headers as specified at:
> > 
> > https://wiki.qt.io/Coding_Conventions#Including_headers
> > 
> > It states:
> > 
> > If you need to include private headers, be careful. Use the following
> > syntax, irrespective of which module or directory whatever_p.h is in.
> > 
> >  #include <private/whatever_p.h>
> > 
> > The issue is that this could lead to collisions. Is it OK to use:
> >  #include <QtModule/private/whatever_p.h>
> > 
> > ?
> 
> You need to be careful when including a private header from another private
> header. But if it's from a .cpp, you can use even relative paths.

What do you have in mind as risk when you say one needs to be careful?
Would that apply for using #include <QtModule/private/foo_p.h> in other 
private headers?

Regards.
-- 
Kévin Ottens, http://ervin.ipsquad.net

KDAB - proud supporter of KDE, http://www.kdab.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4661 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170123/6450f591/attachment.bin>


More information about the Development mailing list