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

henry.haverinen at nokia.com henry.haverinen at nokia.com
Fri Jul 1 12:51:45 CEST 2011


On 7/1/11 11:28 AM, "ext BRM" <bm_witness at yahoo.com> wrote:
>
>As noted elsewhere in this thread, the issue raised is very likely a
>non-issue.
>I do recommend the #include <QtAddon/Foo> and #include <QtAddon/Foo.xxx>
>usage.
>Not only would it bring consistency within Qt - as you note - but it
>would also 
>bring consistency with other larger projects and libraries.

On 7/1/11 11:23 AM, "ext Thiago Macieira" <thiago at kde.org> wrote:

>Do not use dots. Subdirectories are the way to go, as this would otherwise
>create directories with too many files upon installation.


I had missed half of the thread and jumped to conclusions - sorry.
I changed the wiki to say "TBD". Let's finish the discussion first.

So here's another attempt at summarizing what we could do:

//Include all classes of a library in Qt Esssentials or of an add-on that
was a Qt4 library 

#include <QtFoo> 

//include a class from Qt Essentials or from an add-on that was a Qt4 lib

#include <QSomeClass>

//Include all classes from Qt Add-on Foo
//For consistency, this should work for former Qt4 libraries too
#include <QtAddOn/Foo/Foo>

//Include a class from Qt Add-on Foo
#include <QtAddOn/Foo/QSomeClass //class name doesn't have to have the Q
prefix

Cheers,
Henry, who is almost ready to leave for a long vacation :-)




More information about the Qt5-feedback mailing list