summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-02-22 16:36:52 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-29 00:05:38 +0100
commit6363672163a8d40c685c0120f76b261685ee34be (patch)
tree1933fd84d6ce650131b9be578c2d7b99fedf4baf /src/corelib/kernel
parentaac821c220662ec9d1acbf88ac82603bbda3cee8 (diff)
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>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobjectdefs.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index ec51251531..15daf223b9 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -65,8 +65,10 @@ class QString;
# if defined(QT_NO_KEYWORDS)
# define QT_NO_EMIT
# else
-# define slots
-# define signals public
+# ifndef QT_NO_SIGNALS_SLOTS_KEYWORDS
+# define slots
+# define signals public
+# endif
# endif
# define Q_SLOTS
# define Q_SIGNALS public