summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2022-05-13 17:04:13 +0200
committerLuca Di Sera <luca.disera@qt.io>2022-05-18 10:45:32 +0200
commit39f192faeb32578d809c13d3eebe2a22724e2503 (patch)
tree82b24857af86090b9d0079ec1b5722e2b7df0d3f
parentefe7e0cdb578ffa7fe8c8bdfacd71696d8c6d6a7 (diff)
QDoc: Show all inherited members in the all members pages
QDoc produces a reference page containing all members of a class both inherited and "owned". The list was incomplete missing some of the inherited members. For example, in the all members page for `QAbstractItemView`, the `update()` slot from `QWidget` was missing. QDoc generates the list of members for those pages in `sections.cpp`, aggregating the various members in a multimap trough repeated calls to `Section::insert`. In the `insert` method, the code that took care of collecting all the members, so that the all members page can later be generated, specifically avoided collecting members whose name collided with the name of some other member. The name that is used is based on the one produced by `Section::sortName` which doesn't necessarily produce unique names. Indeed, in the `QWidget::update()` case, the produced name collided with the owned `QAbstractItemView::update(const QModelIndex&)` one, such that it was not added to the relevant list of members for the all members page. To fix the issue the check for collision was removed in favor of always collecting all members. It is unclear if there was any historic purpose for the check and why it would be used along with a multimap. The removal of it does not seem to produce any unintended side effect on the current documentation, such that the only noticeable effect is that of adding the missing members to the all members pages. The output files for `tst_generatedOutput` were regenerated to take into account the changes. Fixes: QTBUG-102342 Pick-to: 6.3 6.2 Change-Id: I8f63b9d63e8be2cd2d65e62f91a0b6666935aada Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/qdoc/sections.cpp7
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html1
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html3
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html1
4 files changed, 6 insertions, 6 deletions
diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp
index f22be1b32..55c0ed635 100644
--- a/src/qdoc/sections.cpp
+++ b/src/qdoc/sections.cpp
@@ -194,12 +194,9 @@ void Section::insert(Node *node)
if (node->isDeprecated()) {
m_obsoleteMemberMap.insert(key, node);
} else {
- if (!inherited)
+ if (!inherited || m_style == AllMembers)
m_memberMap.insert(key, node);
- else if (m_style == AllMembers) {
- if (!m_memberMap.contains(key))
- m_memberMap.insert(key, node);
- }
+
if (inherited && (node->parent()->isClassNode() || node->parent()->isNamespace())) {
if (m_inheritedMembers.isEmpty()
|| m_inheritedMembers.last().first != node->parent()) {
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html b/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html
index 0a32e4e60..62c652118 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/crossmodule/testtype-members.html
@@ -22,6 +22,7 @@
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool)</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b></span>(int, int) : int</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b></span>(int, bool)</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#virtualFun">virtualFun</a></b></span>()</li>
</ul>
</body>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html
index f1a359bcc..969a7a097 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html
@@ -25,8 +25,8 @@
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#boolProp-prop">setBoolProp</a></b></span>(bool)</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#bindableProp-prop">bindableProp</a></b></span>() : QBindable&lt;QString&gt;</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#boolProp-prop">boolProp</a></b></span>() : bool</li>
-</ul></td><td class="topAlign"><ul>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#funcPtr">funcPtr</a></b></span>(bool, const char *) : void (*)(bool)</li>
+</ul></td><td class="topAlign"><ul>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#intProp-prop">getInt</a></b></span>() : int *</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#id">id</a></b></span>() : int</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li>
@@ -37,6 +37,7 @@
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b></span>(int, int) : int</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b></span>(int, bool)</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#someProp-prop">someProp</a></b></span>() : const QString &amp;</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#virtualFun">virtualFun</a></b></span>()</li>
</ul>
</td></tr>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html
index dd1911df1..be85e8146 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-testderived-members.html
@@ -22,6 +22,7 @@
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#overload-1">overload</a></b></span>(bool)</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b></span>(int, int) : int</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunctionDefaultArg">someFunctionDefaultArg</a></b></span>(int, bool)</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-test.html#virtualFun">virtualFun</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#virtualFun">virtualFun</a></b></span>()</li>
</ul>
</body>