From 83bf7d82609b45a76c91c2a869cfbcbcbb9e0995 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 5 Dec 2018 13:37:00 +0100 Subject: [PATCH] doc: Let qdoc ignore Q_DECLARE_INTERFACE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This macro declares three template functions that are different for each use of the macro. The functions are in the public API but they are not meant to be documented. This update just defines the macro to be empty so clang in qdoc will ignore it. Without this, clang reports a lot of errors incorrectly, but if we let clang process the macro, it declares all those extra functions which then must be documented with \internal in the cpp files, and we don't want to do that. This will probably be redone in a later version using a custom annotation attribute. Change-Id: I78ae4bcc98a3844b803d7ef7b1eba5d5539b043f Reviewed-by: Tor Arne Vestbø --- src/corelib/kernel/qobject.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index aac9bcdee9..9ae6155f52 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -517,7 +517,10 @@ inline T qobject_cast(const QObject *object) template inline const char * qobject_interface_iid() { return nullptr; } -#if !defined(Q_MOC_RUN) && !defined(Q_CLANG_QDOC) + +#if defined(Q_CLANG_QDOC) +# define Q_DECLARE_INTERFACE(IFace, IId) +#elif !defined(Q_MOC_RUN) # define Q_DECLARE_INTERFACE(IFace, IId) \ template <> inline const char *qobject_interface_iid() \ { return IId; } \