QDoc: Isolate index import and serialization state


QDoc reads dependency index files, writes the module's own index, and
generates WebXML pages using the same `QDocIndexFiles` object. All three
jobs share its state, including the numbers used to reattach related
non-members to their classes on import and the hook WebXML uses to
extend each section it writes. Parts of it outlive the operation that
creates them.

This makes correct output depend on run order. Each operation must
clear what an earlier one left behind. Some leftovers stay harmless
only because the default run mode discards the shared state between
loading dependencies and rendering. A different order, such as a
new output pipeline or concurrent rendering, can let imported
declarations shift the numbering of a module's own related
non-members.

Give every operation its own bookkeeping. Each imported index file
starts fresh, each index export starts fresh, and WebXML output
keeps one numbering across the pages it writes. WebXML hands its
section hook to each serialization directly. Index export also
stops recording data that only imports consume. Output and index
placement remain unchanged.

A new test documents a module that imports a related non-member
from a dependency index and declares one of its own. It verifies
that the local function keeps the first number and that links into
the imported index still resolve. The default run mode passes this
check with or without the change. The test turns an accident of
teardown timing into an explicit guarantee.

Pick-to: 6.12
Fixes: QTBUG-151406
Change-Id: I442d7f87e4337864b8a4aebe37ec739e2056ffcb
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
Reviewed-by: David Boddie <david.boddie@qt.io>
commit5bdd25a7cd713eb82b4e3b391739050deda6926d
parentd28eebecafde9b9b9730fcfb4f51e2d4413fa112
authorPaul Wicking <paul.wicking@qt.io>
committerPaul Wicking <paul.wicking@qt.io>
commit timeThu, 15 Oct 2026 08:39:12 +0000