From 1562cf0d6129886e16c57ac72fab00b309db6bc6 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 15 Apr 2019 22:37:08 +0200 Subject: qdoc: Allow QML/JS types with the same name as the parent module QtMultimedia QML module contains a QML type QtMultimedia. QDoc was overriding one with the other because the search function returns both types of nodes (as they have the same genus, 'QML'). Fix this by checking that we actually found an existing type, not a module. Task-number: QTBUG-75186 Change-Id: Id7a151d6db137fd337e4dd68ebe7c8aa08ed80e0 Reviewed-by: Martin Smith --- src/qdoc/cppcodeparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 74ae8a9ed..05d177f73 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -338,7 +338,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, } else if (command == COMMAND_QMLTYPE) { QmlTypeNode *qcn = nullptr; Node *candidate = qdb_->primaryTreeRoot()->findChildNode(arg.first, Node::QML); - if (candidate != nullptr) + if (candidate != nullptr && candidate->isQmlType()) qcn = static_cast(candidate); else qcn = new QmlTypeNode(qdb_->primaryTreeRoot(), arg.first); @@ -347,7 +347,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, } else if (command == COMMAND_JSTYPE) { QmlTypeNode *qcn = nullptr; Node *candidate = qdb_->primaryTreeRoot()->findChildNode(arg.first, Node::JS); - if (candidate != nullptr) + if (candidate != nullptr && candidate->isJsType()) qcn = static_cast(candidate); else qcn = new QmlTypeNode(qdb_->primaryTreeRoot(), arg.first, Node::JsType); -- cgit v1.2.3