Commit 0d9fa1c7 authored by hjk's avatar hjk

Coding Style: Clarify the use of the Q_OBJECT macro

The old definition sounded like strong but was qualified by an big
'if' at the end, resulting in stating the obvious for a single case
("use it when you need it for qobject_cast").

Having the reminder there is ok, if it is a common thing to forget,
but it should be recognizable as such, and can include "the other
case" where it is typically used.

Change-Id: I0183a12d14c414db9ff8b19598cb9dd22cedda8e
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 67788b6f
......@@ -892,9 +892,10 @@
\section2 Using QObject
\list
\li Every QObject subclass must have a Q_OBJECT macro, even if it
does not have signals or slots, if it is intended to be used
with qobject_cast<>. See also \l{Casting}.
\li Remember to add the Q_OBJECT macro to QObject subclasses that rely
on the meta object system. Meta object system related features are
the definition of signals and slots, the use of \c{qobject_cast<>},
and others. See also \l{Casting}.
\li Prefer Qt5-style \c{connect()} calls over Qt4-style.
\li When using Qt4-style \c{connect()} calls, normalize the arguments
for signals and slots inside connect statements to safely make
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment