summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-09-26 15:25:31 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-27 09:43:30 +0200
commitcf5470e1700e0ca1f5bc828961f19e722fa422fe (patch)
treec48ac24c502fb0f5c3a2284f734e6782e805a2c0 /src/tools/qdoc
parent61c49611fc2e999e2f4467b2ebdb0d188de578e6 (diff)
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 <jerome.pasion@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc')
-rw-r--r--src/tools/qdoc/generator.cpp6
1 files changed, 6 insertions, 0 deletions
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<const TypedefNode *>(node);
+ if (tdef->associatedEnum()) {
+ return fullDocumentLocation(tdef->associatedEnum());
+ }
anchorRef = QLatin1Char('#') + node->name() + "-typedef";
break;
+ }
case Node::Property:
anchorRef = QLatin1Char('#') + node->name() + "-prop";
break;