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>