QDoc: Prefer nearby link targets


When presented with a link that could resolve to one of a number of
identically-named targets, QDoc sometimes chooses targets that are less
relevant. For example, linking to a section on another page when there
is a section on the same page that the writer is referring to.

This change prioritizes links to closely related nodes (the same node,
parent or children) over others unless a keyword was already found.

Existing tests pass and some invalid links in various Qt modules are
corrected by this change.

Change-Id: Ibc120e846807acc2a736d368027af4b51eba4980
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commitac5269884e5e5cbe000e10ff0b06ab013cbaf044
parent3f9e9a6f0168a4cf620fd37d1e0662812931cda5
authorDavid Boddie <david.boddie@qt.io>
committerDavid Boddie <david.boddie@qt.io>
commit timeSat, 26 Sep 2026 07:38:52 +0000