diff options
Diffstat (limited to 'src/corelib/kernel/qobject.h')
-rw-r--r-- | src/corelib/kernel/qobject.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index c06f702b30..69b70ad6ec 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -155,14 +155,14 @@ public: template<typename T> inline T findChild(const QString &aName = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType; + typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType; return static_cast<T>(qt_qFindChild_helper(this, aName, ObjType::staticMetaObject, options)); } template<typename T> inline QList<T> findChildren(const QString &aName = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType; + typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType; QList<T> list; qt_qFindChildren_helper(this, aName, ObjType::staticMetaObject, reinterpret_cast<QList<void *> *>(&list), options); @@ -173,7 +173,7 @@ public: template<typename T> inline QList<T> findChildren(const QRegExp &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType; + typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType; QList<T> list; qt_qFindChildren_helper(this, re, ObjType::staticMetaObject, reinterpret_cast<QList<void *> *>(&list), options); @@ -185,7 +185,7 @@ public: template<typename T> inline QList<T> findChildren(const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { - typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType; + typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType; QList<T> list; qt_qFindChildren_helper(this, re, ObjType::staticMetaObject, reinterpret_cast<QList<void *> *>(&list), options); @@ -210,8 +210,11 @@ public: const char *member, Qt::ConnectionType type = Qt::AutoConnection) const; #ifdef Q_QDOC + template<typename PointerToMemberFunction> static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection); + template<typename PointerToMemberFunction, typename Functor> static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor); + template<typename PointerToMemberFunction, typename Functor> 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 @@ -337,6 +340,7 @@ public: static bool disconnect(const QMetaObject::Connection &); #ifdef Q_QDOC + template<typename PointerToMemberFunction> static bool disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method); #else template <typename Func1, typename Func2> @@ -489,7 +493,7 @@ inline QT_DEPRECATED QList<T> qFindChildren(const QObject *o, const QRegExp &re) template <class T> inline T qobject_cast(QObject *object) { - typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType; + typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType; Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value, "qobject_cast requires the type to have a Q_OBJECT macro"); return static_cast<T>(ObjType::staticMetaObject.cast(object)); @@ -498,7 +502,7 @@ inline T qobject_cast(QObject *object) template <class T> inline T qobject_cast(const QObject *object) { - typedef typename QtPrivate::remove_cv<typename QtPrivate::remove_pointer<T>::type>::type ObjType; + typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType; Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<ObjType>::Value, "qobject_cast requires the type to have a Q_OBJECT macro"); return static_cast<T>(ObjType::staticMetaObject.cast(object)); |