summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.h
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2016-03-09 20:37:17 +0100
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2016-03-29 14:11:05 +0000
commit7d9cbc6b643b472304960842cd60ec4ba3319f37 (patch)
tree04cede6285e0663ac13267669439ab93a537e5e0 /src/corelib/kernel/qmetaobject.h
parent09a1dd2fd4d76a7a7af64cc147b68fda50c17353 (diff)
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 <edward.welbourne@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.h')
-rw-r--r--src/corelib/kernel/qmetaobject.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index f7c60cc309..4d114a5616 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -168,19 +168,15 @@ public:
inline bool isValid() const { return mobj != Q_NULLPTR; }
-#ifdef Q_QDOC
- static QMetaMethod fromSignal(PointerToMemberFunction signal);
-#else
- template <typename Func>
- static inline QMetaMethod fromSignal(Func signal)
+ template <typename PointerToMemberFunction>
+ static inline QMetaMethod fromSignal(PointerToMemberFunction signal)
{
- typedef QtPrivate::FunctionPointer<Func> SignalType;
+ typedef QtPrivate::FunctionPointer<PointerToMemberFunction> SignalType;
Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
"No Q_OBJECT in the class with the signal");
return fromSignalImpl(&SignalType::Object::staticMetaObject,
reinterpret_cast<void **>(&signal));
}
-#endif
private:
#if QT_DEPRECATED_SINCE(5,0)