From cf5470e1700e0ca1f5bc828961f19e722fa422fe Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 26 Sep 2013 15:25:31 +0200 Subject: [PATCH] qdoc: Correct location info for typedefs with associated enums For typedef nodes that have an associated enumeration, qdoc generates incorrect location info (written to index files) by simply appending '-typedef' to the node name. The correct location to link to is the associated enumeration, if one exists. Task-number: QTBUG-33684 Change-Id: I749171ccae9ccc10f084a40fda14e72d5f4d44cf Reviewed-by: Jerome Pasion Reviewed-by: Shawn Rutledge Reviewed-by: Martin Smith --- src/tools/qdoc/generator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 549b3a3918..3306447b34 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -531,8 +531,14 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir) anchorRef = QLatin1Char('#') + node->name() + "-enum"; break; case Node::Typedef: + { + const TypedefNode *tdef = static_cast(node); + if (tdef->associatedEnum()) { + return fullDocumentLocation(tdef->associatedEnum()); + } anchorRef = QLatin1Char('#') + node->name() + "-typedef"; break; + } case Node::Property: anchorRef = QLatin1Char('#') + node->name() + "-prop"; break;