diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-08-22 14:59:48 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-29 12:51:05 +0000 |
commit | c7a656edae2a3b34d737be4684bd3d64038ad2d0 (patch) | |
tree | 3cc91b6ee936fcb2b93c2da501e6be2dba7a3886 | |
parent | 8e316633b62b36156c42b224a1d033feccd3be52 (diff) | |
download | qttools-c7a656edae2a3b34d737be4684bd3d64038ad2d0.tar.gz |
Make order of sections in .qhp file deterministic (take 2)
This amends 9aa6307ccee1. It doesn't help to sort the input list, if the
filtered result is then stored in a QSet.
Fixes: QTBUG-105987
Change-Id: Id187b8ce974b4d9f4bffc3431ecb96077af9bb8c
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 8241d7482cacf851e33b5703a49cabf4e61038d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qdoc/helpprojectwriter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp index 3376d4e7e..d507f9e0e 100644 --- a/src/qdoc/helpprojectwriter.cpp +++ b/src/qdoc/helpprojectwriter.cpp @@ -430,23 +430,25 @@ void HelpProjectWriter::generateSections(HelpProject &project, QXmlStreamWriter const auto *aggregate = static_cast<const Aggregate *>(node); // Ensure that we don't visit nodes more than once. - QSet<const Node *> childSet; + NodeList childSet; NodeList children = aggregate->childNodes(); std::sort(children.begin(), children.end(), Node::nodeNameLessThan); - for (const auto *child : children) { + for (auto *child : children) { // Skip related non-members adopted by some other aggregate if (child->parent() != aggregate) continue; if (child->isIndexNode() || child->isPrivate()) continue; if (child->isTextPageNode()) { - childSet << child; + if (!childSet.contains(child)) + childSet << child; } else { // Store member status of children project.m_memberStatus[node].insert(child->status()); if (child->isFunction() && static_cast<const FunctionNode *>(child)->isOverload()) continue; - childSet << child; + if (!childSet.contains(child)) + childSet << child; } } for (const auto *child : qAsConst(childSet)) |