summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2017-10-26 14:53:28 +0200
committerTopi Reiniƶ <topi.reinio@qt.io>2017-10-27 14:36:53 +0000
commit45559920921336d27baf155dd67d747de3051cd6 (patch)
tree833994e2d0ccf109a6acccffbb3e821eb73e98d7 /src/qdoc/cppcodeparser.cpp
parentc7a77b7d6e8b0b009364636c1011cf4551d04ac0 (diff)
downloadqttools-45559920921336d27baf155dd67d747de3051cd6.tar.gz
qdoc: Improve linking of QML types
QML types and QML basic types were not autolinked correctly in many instances. - Provide correct context (genus) for code quote commands. This guarantees that the types resolve correctly for a \qml snippet even if there are colliding C++ target names. Note: we do not enforce 'CPP' genus for \code command, as it is commonly used also with QML code. - Similarly for examples, each .qml source file is set to have QML genus. - Remove QML basic types from the hard-coded map for known (C++) types/keywords. This prevented linking to these types. Task-number: QTBUG-62440 Change-Id: I578d8d4675e99cb4ba54171031efd8dc93040160 Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 7298d1ec2..29e1c0fe6 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -2678,10 +2678,12 @@ void CppCodeParser::createExampleFileNodes(DocumentNode *dn)
}
foreach (const QString &exampleFile, exampleFiles) {
- new DocumentNode(dn,
+ DocumentNode *fileNode = new DocumentNode(dn,
exampleFile.mid(sizeOfBoringPartOfName),
Node::File,
Node::NoPageType);
+ if (fileNode->name().endsWith(".qml"))
+ fileNode->setGenus(Node::QML);
}
foreach (const QString &imageFile, imageFiles) {
new DocumentNode(dn,