diff options
-rw-r--r-- | generators/qtdoc/qtdocgenerator.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp index 4d764f98a..b2ac7fcd6 100644 --- a/generators/qtdoc/qtdocgenerator.cpp +++ b/generators/qtdoc/qtdocgenerator.cpp @@ -581,11 +581,16 @@ void QtXmlToSphinx::handleLinkTag(QXmlStreamReader& reader) l_linktag = " :func:`"; } else if (l_type == "class") { l_linktag = " :class:`"; - QStringList rawlinklist = l_linkref.split("."); - QStringList splittedContext = m_context.split("."); - if (rawlinklist.size() == 1 || rawlinklist.first() == splittedContext.last()) { - splittedContext.removeLast(); - l_linkref.prepend('~' + splittedContext.join(".") + '.'); + TypeEntry* type = TypeDatabase::instance()->findType(l_linkref); + if (type) { + l_linkref = type->qualifiedTargetLangName(); + } else { // fall back to the old heuristic if the type wasn't found. + QStringList rawlinklist = l_linkref.split("."); + QStringList splittedContext = m_context.split("."); + if (rawlinklist.size() == 1 || rawlinklist.first() == splittedContext.last()) { + splittedContext.removeLast(); + l_linkref.prepend('~' + splittedContext.join(".") + '.'); + } } } else if (l_type == "enum") { l_linktag = " :attr:`"; |