#include <Qt/someheader> not portable

Thiago Macieira thiago at kde.org
Sat Feb 4 12:07:43 GMT 2006

Thomas Braxton wrote:
>> > wrong:
>> > #include <Qt/qwidget.h>
>> >
>> > right:
>> > #include <QtGui/QWidget>
>> > #include <QWidget>
>> > #include <QtGui/qwidget.h>
>> > #include <qwidget.h>
>> >

I'd like to ask that people use only these forms:
#include <QtModule/QClassName>
#include <QtModule/qclassname.h>

The other two forms require more -I switches to the compiler on the 
command-line (one for every Qt module [core, gui, xml, network, testlib, 
qt3support, svg, opengl]). All includes inside the Qt headers themselves 
are of the second form. 

The documentation on doc.trolltech.com says "#include <QClassName>", 

>> Correct, since these are the non-public parts of the Qt API.


>That's not true, on my system Qt/QWidget and QtGui/QWidget are exactly
> the same they each have the same one line
>#include "qwidget.h"
>IIRC the include/Qt dir has all Qt headers in one place instead of them
> being separated by module.

That's not true on all systems. Don't use the other forms.

  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

4. And æfter se scieppend ingelogode, he wrát "cenn", ac eala! se 
rihtendgesamnung andswarode "cenn: ne wát hú cennan 'eall'. Ástynt."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060204/b1ec2e82/attachment.sig>

More information about the kde-core-devel mailing list