Add support for QT_NO_SIGNALS_SLOTS_KEYWORDS
authorStephen Kelly <stephen.kelly@kdab.com>
Wed, 22 Feb 2012 15:36:52 +0000 (16:36 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 28 Feb 2012 23:05:38 +0000 (00:05 +0100)
commit6363672163a8d40c685c0120f76b261685ee34be
tree1933fd84d6ce650131b9be578c2d7b99fedf4baf
parentaac821c220662ec9d1acbf88ac82603bbda3cee8
Add support for QT_NO_SIGNALS_SLOTS_KEYWORDS

QT_NO_KEYWORDS can be used for example to ensure that foreach can
not be used, but Q_FOREACH must be, that slots must not be used but
Q_SLOTS must be, etc.

Typically they are used to avoid symbol conflict with other
libraries that may use the same keywords (I think boost uses
signals).

For 3rd party libraries, it makes sense to use Q_SLOTS and Q_SIGNALS
instead of slots and signals, so that downstreams can still choose
to use QT_NO_KEYWORDS in their code.

The most convenient way to enforce that currently is to define
QT_NO_KEYWORDS when building the 3rd party library. However, that
has the inconvenient side effect of making foreach, forever and emit
not usable within the library implementation.

This patch makes it possible for the 3rd party library to use
QT_NO_SIGNALS_SLOTS_KEYWORDS to exclude signals and slots without
affecting whether the other keywords can be used in the library
implementation.

Change-Id: If1e16a4fa384bd3a2ddd737143499f8b587bc4f8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
src/corelib/kernel/qobjectdefs.h