Skip to content

Commit c0cac4b

Browse files
David BoddieQt Cherry-pick Bot
authored andcommitted
QDoc: Only assign overload numbers to documented functions
Functions were previously assigned numbers whether they were documented or not. This led to links containing overload numbers that did not reflect the number of overloads in the documentation. In the minimal case, a single function with no visible overloads would be assigned a number. The extraction mark is also affected in the minimal case since the [overload1] text is included for primary overloads. Task-number: QTBUG-139262 Change-Id: If4678721c4899525ee9971db48f4c41c9513f464 Reviewed-by: Topi Reiniö <[email protected]> Reviewed-by: Paul Wicking <[email protected]> (cherry picked from commit f3b238d) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
1 parent ecfe041 commit c0cac4b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/qdoc/qdoc/src/qdoc/aggregate.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,13 @@ void Aggregate::normalizeOverloads()
301301
return f1->hasDoc();
302302
return (compare(f1, f2) < 0);
303303
});
304-
// Set overload numbers
304+
// Set overload numbers only if the functions are documented.
305+
// They are not visible if undocumented.
305306
signed short n{0};
306-
for (auto *fn : map_it)
307-
fn->setOverloadNumber(n++);
307+
for (auto *fn : map_it) {
308+
if (fn->hasDoc())
309+
fn->setOverloadNumber(n++);
310+
}
308311
}
309312
}
310313

0 commit comments

Comments
 (0)