#include <QFoo>

Thiago Macieira thiago at kde.org
Thu Jul 27 23:42:09 BST 2006


Allen Winter wrote:
>Yes, this is exactly the Krazy plugin I am working on right now.
>And Thiago's "Just remember..." paragraph confuses me.


>So, you can't just say #include <QString>???
>You must say #include <QtCore/QString>??

Yes. I am saying you must #include <QtCore/QString> in a public header. 
For private headers and .cpp, it doesn't matter.

There's a very simple test that one can do to check for header 
correctness:

#define QT_NO_KEYWORDS
#define QT_NO_CAST_FROM_ASCII
#define QT_NO_CAST_TO_ASCII

#define signals foo
#define slots foo
#define foreach foo
#define forever foo

foreach public header:
#  include header

And then try to compile that with JUST Qt's base include dir 
($QTDIR/include).

The reason this restriction is imposed is to keep the ability of adding 
just -I$QTDIR/include to one's command-line and compiling his simple 
source code, instead of adding all modules.
-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- 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/20060728/8e096069/attachment.sig>


More information about the kde-core-devel mailing list