summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/node.cpp
diff options
context:
space:
mode:
authorMartin Smith <[email protected]>2015-05-27 14:24:26 +0200
committerMartin Smith <[email protected]>2015-06-09 10:10:23 +0000
commit0ec550c748748fcc94008bc2555482bd614251dc (patch)
treee11b382d9331fb30b901108e1935d1e4bd03c1c1 /src/tools/qdoc/node.cpp
parentd12b09edd867648f19764f097bcc7247404b823b (diff)
qdoc: Always try to use the declaration location
qdoc now always tries to use an element's declaration location for the "location," "filepath," and "lineno" attributes in the index file, when it makes sense to use the declaration location. That's pretty much everything in C++. qdoc records both the declaration location and the definition location in the element's tree node. When it writes the element to the index file, it asks for the declaration location. Change-Id: I2d169a0f028bb0d46717e6f822dacc6dd20673b2 Task-number: QTBUG-46034 Reviewed-by: Venugopal Shivashankar <[email protected]> Reviewed-by: Topi Reiniƶ <[email protected]>
Diffstat (limited to 'src/tools/qdoc/node.cpp')
-rw-r--r--src/tools/qdoc/node.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index dbe397357ce..e58e65a633c 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -683,6 +683,24 @@ const Node* Node::root() const
}
/*!
+ Sets the node's declaration location, its definition
+ location, or both, depending on the suffix of the file
+ name from the file path in location \a t.
+ */
+void Node::setLocation(const Location& t)
+{
+ QString suffix = t.fileSuffix();
+ if (suffix == "h")
+ declLocation_ = t;
+ else if (suffix == "cpp")
+ defLocation_ = t;
+ else {
+ declLocation_ = t;
+ defLocation_ = t;
+ }
+}
+
+/*!
\class Aggregate
*/
@@ -2278,16 +2296,16 @@ bool QmlPropertyNode::isWritable()
if (pn)
return pn->isWritable();
else
- location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
- "in C++ class documented as QML type: "
- "(property not found in the C++ class or its base classes)")
- .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
+ defLocation().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
+ "in C++ class documented as QML type: "
+ "(property not found in the C++ class or its base classes)")
+ .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
}
else
- location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
- "in C++ class documented as QML type: "
- "(C++ class not specified or not found).")
- .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
+ defLocation().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
+ "in C++ class documented as QML type: "
+ "(C++ class not specified or not found).")
+ .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
}
}
return true;