diff options
Diffstat (limited to 'src/corelib/kernel/qobject.h')
-rw-r--r-- | src/corelib/kernel/qobject.h | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 1b613a6..d98d1f0 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -325,95 +325,6 @@ Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QString const QMetaObject &mo, QList<void *> *list); Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo); -#if defined Q_CC_MSVC && _MSC_VER < 1300 - -template<typename T> -inline T qFindChild(const QObject *o, const QString &name, T) -{ return static_cast<T>(qt_qFindChild_helper(o, name, ((T)0)->staticMetaObject)); } - -template<typename T> -inline QList<T> qFindChildren(const QObject *o, const QString &name, T) -{ - QList<T> list; - union { - QList<T> *typedList; - QList<void *> *voidList; - } u; - u.typedList = &list; - qt_qFindChildren_helper(o, name, 0, ((T)0)->staticMetaObject, u.voidList); - return list; -} - -template<typename T> -inline T qFindChild(const QObject *o, const QString &name) -{ return qFindChild<T>(o, name, T(0)); } - -template<typename T> -inline T qFindChild(const QObject *o) -{ return qFindChild<T>(o, QString(), T(0)); } - -template<typename T> -inline QList<T> qFindChildren(const QObject *o, const QString &name) -{ return qFindChildren<T>(o, name, T(0)); } - -template<typename T> -inline QList<T> qFindChildren(const QObject *o) -{ return qFindChildren<T>(o, QString(), T(0)); } - -#ifndef QT_NO_REGEXP -template<typename T> -inline QList<T> qFindChildren(const QObject *o, const QRegExp &re, T) -{ - QList<T> list; - union { - QList<T> *typedList; - QList<void *> *voidList; - } u; - u.typedList = &list; - qt_qFindChildren_helper(o, 0, &re, ((T)0)->staticMetaObject, u.voidList); - return list; -} - -template<typename T> -inline QList<T> qFindChildren(const QObject *o, const QRegExp &re) -{ return qFindChildren<T>(o, re, T(0)); } - -#endif - -#ifdef Q_MOC_RUN -# define Q_DECLARE_INTERFACE(IFace, IId) Q_DECLARE_INTERFACE(IFace, IId) -#endif // Q_MOC_RUN - - -template <class T> inline const char * qobject_interface_iid() -{ return 0; } - -template <class T> inline T qobject_cast_helper(QObject *object, T) -{ return static_cast<T>(((T)0)->staticMetaObject.cast(object)); } - -template <class T> inline T qobject_cast_helper(const QObject *object, T) -{ return static_cast<T>(const_cast<const QObject *>(((T)0)->staticMetaObject.cast(const_cast<QObject *>(object)))); } - -template <class T> -inline T qobject_cast(QObject *object) -{ return qobject_cast_helper<T>(object, T(0)); } - -template <class T> -inline T qobject_cast(const QObject *object) -{ return qobject_cast_helper<T>(object, T(0)); } - -#ifndef Q_MOC_RUN -# define Q_DECLARE_INTERFACE(IFace, IId) \ - template <> inline const char *qobject_interface_iid<IFace *>() \ - { return IId; } \ - template <> inline IFace *qobject_cast_helper<IFace *>(QObject *object, IFace *) \ - { return (IFace *)(object ? object->qt_metacast(IId) : 0); } \ - template <> inline IFace *qobject_cast_helper<IFace *>(const QObject *object, IFace *) \ - { return (IFace *)(object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0); } -#endif // Q_MOC_RUN - -#else - template<typename T> inline T qFindChild(const QObject *o, const QString &name) { return static_cast<T>(qt_qFindChild_helper(o, name, reinterpret_cast<T>(0)->staticMetaObject)); } @@ -482,8 +393,6 @@ template <class T> inline const char * qobject_interface_iid() { return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0)); } #endif // Q_MOC_RUN -#endif - #ifndef QT_NO_DEBUG_STREAM Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *); #endif |