QDoc: Honor upstream module identity on placeholders


When a consumer module declares membership in a group or module owned
by another module, QDoc creates a placeholder collection node in the
consumer's primary tree and the merge step records the upstream
identity on it. Reference-page rendering then asks HrefResolver to
compute a link for that placeholder.

HrefResolver reads the node's tree to derive the cross-module path
prefix, and for a placeholder that returns the consumer module's own
name. The computed prefix collapses to nothing and the rendered href
ends up as a bare filename or an empty string that the browser
resolves into the consumer's own output directory. The "is part of"
listing on roughly a hundred class pages across qtgui, qtnetwork,
qtsql, and similar modules sees this — every cross-module group link
lands in the wrong place under the new template-html layout.

HrefResolver now consults the placeholder's recorded upstream identity
in preference to its tree's identity, and admits the placeholder
through both the inclusion-policy gate and the cross-module-prefix
gate that previously fired only for index-loaded nodes. The computed
prefix reflects content origin rather than placeholder location. The
synthetic cross_module_links fixture exercises the listing path; its
regenerated template-html snapshots demonstrate the corrected href
shape on the class page's "is part of" line and the consumer-index
breadcrumb. Legacy HTML and DocBook output are unaffected — a
short-circuit in XmlGenerator::linkForNode hides the underlying
identity mismatch for legacy callers, so the legacy snapshots stay
byte-identical.

Fixes: QTBUG-146866
Change-Id: I9a170f426284f7a0a4e56124173c76b9121abb3f
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commita3589225edafd6318c9fc072bb30223b865cd275
parentf375a972f4d051c6d22669f6f5d37854ee5981dd
authorPaul Wicking <paul.wicking@qt.io>
committerPaul Wicking <paul.wicking@qt.io>
commit timeWed, 20 May 2026 14:27:28 +0000