From 0d43b8c617c4bb564e0789994de94f26506ad30b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 13 Mar 2012 14:46:28 +0100 Subject: qdoc3: qdoc now handles overloaded methods for QML When a C++ class is documented as a QML type, it can have overloaded QML methods. These are now handled correctly by qdoc. The method list for QML types is now output with the full method signature. For signals and handlers too. Task-number: QTBUG-24670 Change-Id: If529d4136f5b480373b6ac25d2dceef15e6ea3db Reviewed-by: Casper van Donderen --- src/tools/qdoc/codemarker.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/tools/qdoc/codemarker.cpp') diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index 791e08062b..9f22a287d2 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -288,12 +288,17 @@ QString CodeMarker::taggedNode(const Node* node) } tag = QLatin1String("@property"); break; + case Node::QmlMethod: + case Node::QmlSignal: + case Node::QmlSignalHandler: + tag = QLatin1String("@function"); + break; default: tag = QLatin1String("@unknown"); break; } - return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name) - + QLatin1String("'); + return (QLatin1Char('<') + tag + QLatin1Char('>') + protect(name) + + QLatin1String("')); } QString CodeMarker::taggedQmlNode(const Node* node) @@ -373,6 +378,13 @@ QString CodeMarker::sortName(const Node *node, const QString* name) if (node->type() == Node::Property || node->type() == Node::Variable) return QLatin1Char('E') + nodeName; + if ((node->type() == Node::QmlMethod) || + (node->type() == Node::QmlSignal) || + (node->type() == Node::QmlSignalHandler)) { + const FunctionNode* func = static_cast(node); + return QLatin1String("E") + func->signature(); + } + return QLatin1Char('B') + nodeName; } -- cgit v1.2.3