Replace unusable \Q_OBJECT macro in documentation
moc/AUTOMOC will detect Q_OBJECT macros in code, regardless of whether
it is in a comment or not. This is why originally a qdoc macro Q_OBJECT
was introduced.
Anyhow, due to the underscore, qdoc never did treat \Q_OBJECT as a macro
invocation of this, resulting in \Q_OBJECT being verbally printed in the
generated documentation.
Fix this by moving the snippet into its own file. This also allows
compile-testing it as a bonus point.
Pick-to: 6.8
Task-number: QTBUG-130799
Change-Id: Ic586dcf6b403ff3d3be513b6cc95bed191862ef4
Reviewed-by: Lorn Potter <lorn.potter@qt.io>