From 7d9cbc6b643b472304960842cd60ec4ba3319f37 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 9 Mar 2016 20:37:17 +0100 Subject: Fix Q_QDOC code for PointerToMemberFunction In functions such as QObject::connect and similar which are using pointer to member function or functor, we have a different declaration for qdoc because we don't want to show the QEnableIf and other type traits in the doc. However, The code still needs to be valid, as we will use clang to parse the documentation. Fix it by making 'PointerToMemberFunction' and 'Functor' template parameters (which they actually are). Change-Id: Ie2648407bae21ba6d1677f6de2d6f597486b5c98 Reviewed-by: Edward Welbourne Reviewed-by: Martin Smith --- src/corelib/kernel/qobject.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/kernel/qobject.h') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 1f3d3dcfc7..87d006bdc6 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -210,8 +210,11 @@ public: const char *member, Qt::ConnectionType type = Qt::AutoConnection) const; #ifdef Q_QDOC + template static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection); + template static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor); + template static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection); #else //Connect a signal to a pointer to qobject member function @@ -360,6 +363,7 @@ public: static bool disconnect(const QMetaObject::Connection &); #ifdef Q_QDOC + template static bool disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method); #else template -- cgit v1.2.3