moc generated code should compile with QT_NO_KEYWORDS
Don't use the 'emit' keyword in the moc generated code for properties with MEMBER Task-number: QTBUG-33094 Change-Id: I5a0950e9c7a0dee347a6a6c79098e3e7d4776014 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
2bd40c53ef
commit
8a96679493
|
|
@ -984,9 +984,9 @@ void Generator::generateMetacall()
|
|||
if (!p.notify.isEmpty() && p.notifyId != -1) {
|
||||
const FunctionDef &f = cdef->signalList.at(p.notifyId);
|
||||
if (f.arguments.size() == 0)
|
||||
fprintf(out, " emit %s();\n", p.notify.constData());
|
||||
fprintf(out, " Q_EMIT %s();\n", p.notify.constData());
|
||||
else if (f.arguments.size() == 1 && f.arguments.at(0).normalizedType == p.type)
|
||||
fprintf(out, " emit %s(%s%s);\n",
|
||||
fprintf(out, " Q_EMIT %s(%s%s);\n",
|
||||
p.notify.constData(), prefix.constData(), p.member.constData());
|
||||
}
|
||||
fprintf(out, " }\n");
|
||||
|
|
|
|||
|
|
@ -3033,5 +3033,10 @@ void tst_Moc::QTBUG32933_relatedObjectsDontIncludeItself()
|
|||
|
||||
QTEST_MAIN(tst_Moc)
|
||||
|
||||
// the generated code must compile with QT_NO_KEYWORDS
|
||||
#undef signals
|
||||
#undef slots
|
||||
#undef emit
|
||||
|
||||
#include "tst_moc.moc"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue