[Qt5-feedback] The #include directives for Qt Essentials and Qt Add-on modules

shane.kearns at accenture.com shane.kearns at accenture.com
Fri Jul 1 15:15:52 CEST 2011


> -----Original Message-----
> From: qt5-feedback-bounces+shane.kearns=accenture.com at qt.nokia.com
> [mailto:qt5-feedback-bounces+shane.kearns=accenture.com at qt.nokia.com]
> On Behalf Of lars.knoll at nokia.com
> Sent: Friday, July 01, 2011 13:31
> To: henry.haverinen at nokia.com; qt5-feedback at qt.nokia.com
> Subject: Re: [Qt5-feedback] The #include directives for Qt Essentials
> and Qt Add-on modules
>
> Yes, that's how it would look. And the advantage is that you only need
> to
> specify one include path on the compiler command line.
>
> Pushing it all into one directory is a no-go for many reasons. We're
> currently talking about how the include statements would look like.
> That
> depends on what you specifyon the compiler command line.
>
> So instead of looking at the include statements we should probably
> rather
> write down how the directory structure of Qt essential and Qt addon
> includes look like. On Unix, they'd all be under /usr/include so
> something
> like /usr/include/qt5/ should be the common base dir.
>
> In there, it should IMO look something like:
>
> QtCore/Qcore
> QtCore/qlist.h
> ...
> QtGui/QtGui
> QtGui/Qpainter
> ...
> QtAddons/MyAddon/MyAddon
> QtAddons/MyAddon/myheader.h
> QtAddons/AnotherAddon/...
>
>
> Cheers,
> Lars
>

Adding include paths on the compiler command line is similar to the "using namespace" in source files.
"-I/usr/include/qt5/QtAddons/MyAddon" would allow short #include statements with the same tradeoffs about
potential class name collisions as "using namespace QtAddons::MyAddon"

So I think you have the right idea here.
There's a requirement on the qt5 build system to easily support controlling include paths in the generated make files.

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.


More information about the Qt5-feedback mailing list