From f71aeea9329faf33d7161e6af88e2a94a35edb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Tue, 12 Jul 2022 16:07:23 +0200 Subject: [PATCH] Doc: Hide weak overload template magic from documentation Hide the 'template magic' to implement Q_WEAK_OVERLOAD from the documentation. So far Q_WEAK_OVERLOAD void foo() lead to template void foo() in the generated documentation, which is arguably confusing to the uninitiated. And people interested in implementation details & exact overload resolution will arguably just read the .h files themselves. Fixes: QTBUG-104851 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I5e0b1b337b28e621e6a627241aa8037da0a879a7 Reviewed-by: Marc Mutz --- doc/global/qt-cpp-defines.qdocconf | 1 - src/corelib/global/qcompilerdetection.h | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf index c2a267d08e8..b31cec2f0d1 100644 --- a/doc/global/qt-cpp-defines.qdocconf +++ b/doc/global/qt-cpp-defines.qdocconf @@ -123,7 +123,6 @@ Cpp.ignoretokens += \ Q_SVG_EXPORT \ Q_TESTLIB_EXPORT \ Q_TYPENAME \ - Q_WEAK_OVERLOAD \ Q_WIDGETS_EXPORT \ Q_WINEXTRAS_EXPORT \ Q_XML_EXPORT \ diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 5370e258808..74f6ebd41e7 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1027,7 +1027,11 @@ * "Weak overloads" - makes an otherwise confliciting overload weaker * (by making it a template) */ -#define Q_WEAK_OVERLOAD template +#ifndef Q_CLANG_QDOC +# define Q_WEAK_OVERLOAD template +#else +# define Q_WEAK_OVERLOAD +#endif /* * If one wants to add functions that use post-C++17 APIs, one needs to: