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>
bb10
Topi Reinio 2013-09-26 15:25:31 +02:00 committed by The Qt Project
parent 61c49611fc
commit cf5470e170
1 changed files with 6 additions and 0 deletions

View File

@ -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;