[Development] From whence cometh Q_NAMESPACE?

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Jun 11 19:58:38 CEST 2019


On 11/06/2019 19:24, Matthew Woehlke wrote:
> So, my questions are:
> 
> 1. Is it really Qt's intent that using Q_NAMESPACE, etc. requires
> including <QObject>?
> 
> 2. If not, is it worth tweaking the documentation to make it clearer
> that <QMetaObject> is sufficient?
> 
> (I don't see why we would need to "specify that macro for multiple
> targets"... just "move" it to QMetaObject. It should be clear that
> <QObject> includes <QMetaObject>.)

I wouldn't rely on that transitive inclusion. Anyhow, we have two 
problems at hand:

* one is a documentation one: how do we make these macros discoverable 
without spreading in N documentation pages? How do we specify what's the 
right include to get a macro (when it's a transitive include like this one)?

* another one is which one is the "right" include for pulling in the 
meta object macros. It could even be an include different from QObject 
and QMetaObject...

Cheers,

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190611/1e8e6c20/attachment.bin>


More information about the Development mailing list