QDoc: Fix cross-module link resolution


When qdoc generates docs for a module that depends on another — for
example, qtcore depending on qtdoc — references from pages in the
first module to pages in the second arrive through index files. The
.index reader prefixes every URL with a relative path to the
dependency's output directory, producing hrefs such as
"../qtdoc/threads-reentrancy.html". Under flat per-module output,
the template generator's href resolver then stripped that prefix
back off and returned the bare filename. The browser resolved the
resulting href against the current module's directory — the wrong
location — and readers arrived at a 404 following any cross-module
link in template-generated output.

The href resolver now leaves URLs that start with "../" intact. The
single-subdirectory flatten behavior continues to apply to legacy
same-module URLs that carry a prefix invalid for flat output,
preserving the original motivation for that path. The legacy HTML
generator already resolves cross-module links this way; the template
generator now matches.

Task-number: QTBUG-143488
Change-Id: I48b3233cd58f8dd427b8d9bd2c5124acbe897ec8
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commit7cf1d62f3a4cdd9951f7849849f0854f8e52f3b1
parent05a9785db959cc7056c801ded45b777d3f31c654
authorPaul Wicking <paul.wicking@qt.io>
committerPaul Wicking <paul.wicking@qt.io>
commit timeThu, 23 Apr 2026 20:45:20 +0000