summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qdoc/htmlgenerator.cpp11
-rw-r--r--src/qdoc/node.cpp14
-rw-r--r--src/qdoc/node.h1
3 files changed, 24 insertions, 2 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp
index 137da05ff..60ed94981 100644
--- a/src/qdoc/htmlgenerator.cpp
+++ b/src/qdoc/htmlgenerator.cpp
@@ -3943,8 +3943,15 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
if (node && node->parent() &&
(node->parent()->isQmlType() || node->parent()->isJsType())
&& node->parent()->isAbstract()) {
- if (Generator::qmlTypeContext())
- fn = fileName(Generator::qmlTypeContext());
+ if (Generator::qmlTypeContext()) {
+ if (Generator::qmlTypeContext()->inherits(node->parent())) {
+ fn = fileName(Generator::qmlTypeContext());
+ }
+ else if (node->parent()->isInternal()) {
+ node->doc().location().warning(tr("Cannot link to property in internal type '%1'").arg(node->parent()->name()));
+ return QString();
+ }
+ }
}
QString link = fn;
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index e2ed08032..7e3b2d96a 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -2669,6 +2669,20 @@ QString QmlTypeNode::logicalModuleIdentifier() const
}
/*!
+ Returns true if this QML type inherits \a type.
+ */
+bool QmlTypeNode::inherits(Aggregate* type)
+{
+ QmlTypeNode* qtn = qmlBaseNode();
+ while (qtn != 0) {
+ if (qtn == type)
+ return true;
+ qtn = qtn->qmlBaseNode();
+ }
+ return false;
+}
+
+/*!
Constructs a Qml basic type node. The new node has the given
\a parent and \a name.
*/
diff --git a/src/qdoc/node.h b/src/qdoc/node.h
index faea2dcb1..38fc99f03 100644
--- a/src/qdoc/node.h
+++ b/src/qdoc/node.h
@@ -677,6 +677,7 @@ public:
static void addInheritedBy(const Node *base, Node* sub);
static void subclasses(const Node *base, NodeList& subs);
static void terminate();
+ bool inherits(Aggregate* type);
public:
static bool qmlOnly;