Doc: 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 it's own file. This also allows
compile-testing it as a bonus point.

Task-number: QTBUG-130799
Pick-to: 6.8
Change-Id: I7b737ec06dc9eb58d5cacb218f039dcc8b871ef8
Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
commit267f463d7ed525479579fda394b0129f1087200b
parentde6ed374ce3e8808cec3ff1804bdda6cde359e49
authorKai Köhne <kai.koehne@qt.io>
committerKai Köhne <kai.koehne@qt.io>
commit timeTue, 19 Nov 2024 11:27:27 +0100