diff options
-rw-r--r-- | src/qdoc/cppcodemarker.cpp | 6 | ||||
-rw-r--r-- | src/qdoc/qdocdatabase.cpp | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index d4e7546e9..b0e4e823d 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -1306,6 +1306,12 @@ QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyl } ++c; } + if (current->qmlBaseNode() == current) { + qDebug() << "qdoc internal error: circular type definition." + << "QML type" << current->name() + << "can't be its own base type"; + break; + } current = current->qmlBaseNode(); while (current) { if (current->isAbstract()) diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp index 1707963c8..e3331a4f0 100644 --- a/src/qdoc/qdocdatabase.cpp +++ b/src/qdoc/qdocdatabase.cpp @@ -1460,21 +1460,21 @@ void QDocDatabase::resolveQmlInheritance(Aggregate* root) QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child); if (qcn->qmlBaseNodeNotSet() && !qcn->qmlBaseName().isEmpty()) { QmlTypeNode* bqcn = static_cast<QmlTypeNode*>(previousSearches.value(qcn->qmlBaseName())); - if (bqcn) + if (bqcn && (bqcn != qcn)) qcn->setQmlBaseNode(bqcn); else { if (!qcn->importList().isEmpty()) { const ImportList& imports = qcn->importList(); for (int i=0; i<imports.size(); ++i) { bqcn = findQmlType(imports[i], qcn->qmlBaseName()); - if (bqcn) + if (bqcn && (bqcn != qcn)) break; } } if (bqcn == 0) { bqcn = findQmlType(QString(), qcn->qmlBaseName()); } - if (bqcn) { + if (bqcn && (bqcn != qcn)) { qcn->setQmlBaseNode(bqcn); previousSearches.insert(qcn->qmlBaseName(), bqcn); } |