QDoc: Extract atom dispatch from content traversal loop


The content builder's traversal loop mixes iteration with dispatch.
Separating these concerns prepares for format-conditional traversal,
where the loop needs to detect boundary atoms before dispatching
content atoms.

The dispatch function returns the last atom it consumed instead of
void, preparing for atom types that consume trailing atoms from the
chain.

Task-number: QTBUG-144240
Change-Id: I315052b342e72ceca2d1970f80a5e90e52bebbdb
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commit409cd271b4bf7ead8c27d3367af4d2d9c31142a9
parenta8ab064619dddc058ece6d873b0090a85a23c055
authorPaul Wicking <paul.wicking@qt.io>
committerPaul Wicking <paul.wicking@qt.io>
commit timeFri, 20 Feb 2026 13:54:11 +0100