From 49bd825a9626eda77fd9e8313e1868bed4c77bff Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 31 Oct 2011 15:22:31 +0100 Subject: moc: support mapping pointers to member functions to indexes This change adds QMetaObject::IndexOfMethod as a parameter to the qt_static_metacall function. It lets the moc generated code return the index of a signal or slot given its pointer to member function This is required to support the new connection syntax Change-Id: I39198c6699b5aa3599d3d282f7ac79b1e3684d33 Reviewed-by: Bradley T. Hughes Reviewed-by: Thiago Macieira --- src/tools/moc/moc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tools/moc/moc.cpp') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 8999148108..6086eb0ddb 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -240,6 +240,7 @@ Type Moc::parseType() else if (lookup(0) == STAR) type.referenceType = Type::Pointer; } + type.rawName = type.name; // transform stupid things like 'const void' or 'void const' into 'void' if (isVoid && type.referenceType == Type::NoReference) { type.name = "void"; @@ -404,8 +405,11 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro) } // we don't support references as return types, it's too dangerous - if (def->type.referenceType == Type::Reference) + if (def->type.referenceType == Type::Reference) { + QByteArray rawName = def->type.rawName; def->type = Type("void"); + def->type.rawName = rawName; + } def->normalizedType = normalizeType(def->type.name); -- cgit v1.2.3