diff options
author | Topi Reinio <topi.reinio@theqtcompany.com> | 2016-01-11 10:33:53 +0100 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@theqtcompany.com> | 2016-01-11 14:24:15 +0000 |
commit | f0644bd7992da4125bd307ee72d49b40ef589805 (patch) | |
tree | fa38f088507443770a264a4b23692b2c435daeb4 | |
parent | 8cb52df34ffc5a60d280277cb40df04db1640172 (diff) |
qdoc: Allow specifying a module name as QHP selector
Previously, there was no machanism to list the members of a specific
C++/QML module in a table of contents subsection.
This allows the above, with following syntax:
qhp.project.subprojects.name.title = Qt FooBar Classes
qhp.project.subprojects.name.indexTitle = Qt FooBar C++ Classes
qhp.project.subprojects.name.selectors = module:QtFooBar
Change-Id: I1547df3618c2daf8d24987c67e337e9dc99835b5
Task-number: QTBUG-50334
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
-rw-r--r-- | src/qdoc/doc/qdoc-manual-qdocconf.qdoc | 6 | ||||
-rw-r--r-- | src/qdoc/helpprojectwriter.cpp | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc index 045be3b33..7579a5598 100644 --- a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc +++ b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc @@ -1176,8 +1176,10 @@ \row \li \c class \li Classes \row \li \c qmltype \li QML Types \row \li \c qmlclass \li Alias for \c qmltype. - \row \li \c module \li C++ Modules - \row \li \c qmlmodule \li QML Modules + \row \li \c module[:name] \li C++ modules or members of the module + with a specified name. + \row \li \c qmlmodule[:name] \li QML modules or members of the module + with a specified name. \row \li \c doc[:subtype] \li Documentation pages with a specified \c subtype. Multiple subtypes can be listed as a comma-separated list. diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp index eb15ab50d..1689c0575 100644 --- a/src/qdoc/helpprojectwriter.cpp +++ b/src/qdoc/helpprojectwriter.cpp @@ -166,7 +166,9 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList QSet<Node::DocSubtype> docSubtypes; for (int i = 0; i < pieces.size(); ++i) { QString piece = pieces[i].toLower(); - if (typeHash[docType] == Node::Group) { + if (typeHash[docType] == Node::Group + || typeHash[docType] == Node::Module + || typeHash[docType] == Node::QmlModule) { subproject.groups << piece; continue; } @@ -260,9 +262,9 @@ bool HelpProjectWriter::generateSection(HelpProject &project, project.subprojects[i].nodes[objName] = node; } else if (subproject.selectors.contains(node->type())) { - // Add all group members for 'group:name' selector - if (node->isGroup()) { - if (project.subprojects[i].groups.contains(node->name())) { + // Add all group members for '[group|module|qmlmodule]:name' selector + if (node->isGroup() || node->isModule() || node->isQmlModule()) { + if (project.subprojects[i].groups.contains(node->name().toLower())) { const CollectionNode* cn = static_cast<const CollectionNode*>(node); foreach (const Node* m, cn->members()) { QString memberName = m->isDocumentNode() |