qobject.h File Reference

#include <QtCore/qobjectdefs.h>
#include <QtCore/qstring.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
#include <QtCore/qscopedpointer.h>

Go to the source code of this file.

Classes

class   QObjectData
class   QObject
class   QObjectUserData

Defines

#define  Q_DECLARE_INTERFACE(IFace, IId)

Typedefs

typedef QList< QObject * >  QObjectList

Functions

template<typename T >
qFindChild (const QObject *, const QString &=QString())
template<typename T >
QList< T >  qFindChildren (const QObject *, const QString &=QString())
template<typename T >
QList< T >  qFindChildren (const QObject *, const QRegExp &)
Q_CORE_EXPORT void  qt_qFindChildren_helper (const QObject *parent, const QString &name, const QRegExp *re, const QMetaObject &mo, QList< void * > *list)
Q_CORE_EXPORT QObject qt_qFindChild_helper (const QObject *parent, const QString &name, const QMetaObject &mo)
template<class T >
qobject_cast (QObject *object)
template<class T >
qobject_cast (const QObject *object)
template<class T >
const char *  qobject_interface_iid ()
Q_CORE_EXPORT QDebug  operator<< (QDebug, const QObject *)

Define Documentation

#define Q_DECLARE_INTERFACE (   IFace,
  IId 
)
Value:
template <> inline const char *qobject_interface_iid<IFace *>() \
    { return IId; } \
    template <> inline IFace *qobject_cast<IFace *>(QObject *object) \
    { return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : 0)); } \
    template <> inline IFace *qobject_cast<IFace *>(const QObject *object) \
    { return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0)); }

Definition at line 387 of file qobject.h.


Typedef Documentation

Definition at line 75 of file qobject.h.


Function Documentation

T qFindChild ( const QObject o,
const QString name = QString() 
) [inline]

Definition at line 329 of file qobject.h.

{ return static_cast<T>(qt_qFindChild_helper(o, name, reinterpret_cast<T>(0)->staticMetaObject)); }
QList< T > qFindChildren ( const QObject o,
const QString name = QString() 
) [inline]

Definition at line 333 of file qobject.h.

{
    QList<T> list;
    union {
        QList<T> *typedList;
        QList<void *> *voidList;
    } u;
    u.typedList = &list;
    qt_qFindChildren_helper(o, name, 0, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
    return list;
}
QList< T > qFindChildren ( const QObject o,
const QRegExp re 
) [inline]

Definition at line 347 of file qobject.h.

{
    QList<T> list;
    union {
        QList<T> *typedList;
        QList<void *> *voidList;
    } u;
    u.typedList = &list;
    qt_qFindChildren_helper(o, QString(), &re, reinterpret_cast<T>(0)->staticMetaObject, u.voidList);
    return list;
}
Q_CORE_EXPORT void qt_qFindChildren_helper ( const QObject parent,
const QString name,
const QRegExp re,
const QMetaObject mo,
QList< void * > *  list 
)
Q_CORE_EXPORT QObject* qt_qFindChild_helper ( const QObject parent,
const QString name,
const QMetaObject mo 
)
T qobject_cast ( QObject object ) [inline]

Definition at line 361 of file qobject.h.

{
#if !defined(QT_NO_MEMBER_TEMPLATES) && !defined(QT_NO_QOBJECT_CHECK)
    reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
#endif
    return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
}
T qobject_cast ( const QObject object ) [inline]

Definition at line 370 of file qobject.h.

{
    // this will cause a compilation error if T is not const
    register T ptr = static_cast<T>(object);
    Q_UNUSED(ptr);

#if !defined(QT_NO_MEMBER_TEMPLATES) && !defined(QT_NO_QOBJECT_CHECK)
    reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
#endif
    return static_cast<T>(const_cast<QObject *>(reinterpret_cast<T>(0)->staticMetaObject.cast(const_cast<QObject *>(object))));
}
const char* qobject_interface_iid ( ) [inline]

Definition at line 383 of file qobject.h.

{ return 0; }
Q_CORE_EXPORT QDebug operator<< ( QDebug  ,
const QObject  
)