Pattern
Callback-Driven HTML Serialization
callback-driven-html-serialization
Lexbor’s HTML serializer streams output via a callback, so writing to QFile must be orchestrated around when serialization produces bytes; otherwise you end up with missing/empty files because the DOM wasn’t serialized into the buffer first.