summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-02-23 11:12:58 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-27 00:18:53 +0100
commit5bb1408927b4eb5a03e8ab9f7cbc68f80d8a3962 (patch)
tree827b626deccbbf6e71668e6549ef4761ae7a22e8 /src/corelib/kernel
parent4550f0db210258338c8d6261640d9f192c0d3db6 (diff)
Allow moc to handle symbols that have been redefined.
Allow moc to produce the desired identifiers when used with C++ symbol names that have been redefined, for example by -Dfoo=bar. Two changes are required: firstly, when encoding a type name, the components of the name must be checked for substitutions that have been defined for that token (note that this is not done here by correct pre-processing, but only by processing the resultant table of definitions). Secondly, the arguments to the SIGNAL, SLOT and METHOD macros must be allowed to be substituted during macro expansion rather than stringized directly. This is a temporary change to prevent breaking existing projects that depend on the declarative module. After clients have had an opportunity to update their code to the use the new interfaces, it can be removed. Task-number: QTBUG-23737 Change-Id: I39e6844cebf6ca7984af6028160b8a3797ac44a5 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobjectdefs.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 0b1fa8839f..45ef8ab3ca 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -208,16 +208,16 @@ Q_CORE_EXPORT const char *qFlagLocation(const char *method);
#ifndef QT_NO_DEBUG
# define QLOCATION "\0" __FILE__ ":" QTOSTRING(__LINE__)
# ifndef QT_NO_KEYWORDS
-# define METHOD(a) qFlagLocation("0"#a QLOCATION)
+# define METHOD(a) qFlagLocation("0" QTOSTRING(a) QLOCATION)
# endif
-# define SLOT(a) qFlagLocation("1"#a QLOCATION)
-# define SIGNAL(a) qFlagLocation("2"#a QLOCATION)
+# define SLOT(a) qFlagLocation("1" QTOSTRING(a) QLOCATION)
+# define SIGNAL(a) qFlagLocation("2" QTOSTRING(a) QLOCATION)
#else
# ifndef QT_NO_KEYWORDS
-# define METHOD(a) "0"#a
+# define METHOD(a) "0" QTOSTRING(a)
# endif
-# define SLOT(a) "1"#a
-# define SIGNAL(a) "2"#a
+# define SLOT(a) "1" QTOSTRING(a)
+# define SIGNAL(a) "2" QTOSTRING(a)
#endif
#define QMETHOD_CODE 0 // member type codes