QtBase  v6.3.1
Classes | Namespaces | Macros | Typedefs | Functions
qobject.h File Reference
#include <QtCore/qobjectdefs.h>
#include <QtCore/qstring.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qobject_impl.h>
#include <QtCore/qbindingstorage.h>
Include dependency graph for qobject.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QObjectData
 
class  QObject
 The QObject class is the base class of all Qt objects. More...
 
class  QSignalBlocker
 Exception-safe wrapper around QObject::blockSignals(). More...
 

Namespaces

 QtPrivate
 

Macros

#define Q_DECLARE_INTERFACE(IFace, IId)
 
#define Q_SET_OBJECT_NAME(obj)   QT_PREPEND_NAMESPACE(QtPrivate)::deref_for_methodcall(obj).setObjectName(QLatin1String(#obj))
 

Typedefs

typedef QList< QObject * > QObjectList
 

Functions

Q_CORE_EXPORT void qt_qFindChildren_helper (const QObject *parent, const QString &name, const QMetaObject &mo, QList< void * > *list, Qt::FindChildOptions options)
 
Q_CORE_EXPORT void qt_qFindChildren_helper (const QObject *parent, const QMetaObject &mo, QList< void * > *list, Qt::FindChildOptions options)
 
Q_CORE_EXPORT void qt_qFindChildren_helper (const QObject *parent, const QRegularExpression &re, const QMetaObject &mo, QList< void * > *list, Qt::FindChildOptions options)
 
Q_CORE_EXPORT QObjectqt_qFindChild_helper (const QObject *parent, const QString &name, const QMetaObject &mo, Qt::FindChildOptions options)
 
template<class T >
T qobject_cast (QObject *object)
 
template<class T >
T qobject_cast (const QObject *object)
 
template<class T >
constexpr const char * qobject_interface_iid ()=delete
 
template<class T >
Tqobject_iid_cast (QObject *object, const char *IId=qobject_interface_iid< T * >())
 
template<class T >
std::enable_if_t< std::is_const< T >::value, T * > qobject_iid_cast (const QObject *object)
 
const QBindingStorageqGetBindingStorage (const QObject *o)
 
QBindingStorageqGetBindingStorage (QObject *o)
 
Q_CORE_EXPORT QDebug operator<< (QDebug, const QObject *)
 
QObjectQtPrivate::deref_for_methodcall (QObject &o)
 
QObjectQtPrivate::deref_for_methodcall (QObject *o)
 

Macro Definition Documentation

◆ Q_DECLARE_INTERFACE

#define Q_DECLARE_INTERFACE (   IFace,
  IId 
)
Value:
template <> constexpr const char *qobject_interface_iid<IFace *>() \
{ return IId; } \
template <> inline IFace *qobject_cast<IFace *>(QObject *object) \
{ return qobject_iid_cast<IFace>(object); } \
template <> inline const IFace *qobject_cast<const IFace *>(const QObject *object) \
{ return qobject_iid_cast<const IFace>(object); }
The QObject class is the base class of all Qt objects.
Definition: qobject.h:125

Definition at line 504 of file qobject.h.

◆ Q_SET_OBJECT_NAME

#define Q_SET_OBJECT_NAME (   obj)    QT_PREPEND_NAMESPACE(QtPrivate)::deref_for_methodcall(obj).setObjectName(QLatin1String(#obj))

Definition at line 606 of file qobject.h.

Typedef Documentation

◆ QObjectList

typedef QList<QObject*> QObjectList
related

Definition at line 82 of file qobject.h.

Function Documentation

◆ operator<<()

Q_CORE_EXPORT QDebug operator<< ( QDebug  dbg,
const QObject o 
)

Definition at line 4279 of file qobject.cpp.

Here is the call graph for this function:

◆ qGetBindingStorage() [1/2]

const QBindingStorage* qGetBindingStorage ( const QObject o)
inline

Definition at line 513 of file qobject.h.

Here is the caller graph for this function:

◆ qGetBindingStorage() [2/2]

QBindingStorage* qGetBindingStorage ( QObject o)
inline

Definition at line 517 of file qobject.h.

◆ qobject_cast() [1/2]

template<class T >
T qobject_cast ( const QObject object)
related

Definition at line 478 of file qobject.h.

◆ qobject_cast() [2/2]

template<class T >
template< class T > T qobject_cast ( QObject object)
inline

\variable QObject::staticMetaObject

This variable stores the meta-object for the class.

A meta-object contains information about a class that inherits QObject, e.g. class name, superclass name, properties, signals and slots. Every class that contains the Q_OBJECT macro will also have a meta-object.

The meta-object information is required by the signal/slot connection mechanism and the property system. The inherits() function also makes use of the meta-object.

If you have a pointer to an object, you can use metaObject() to retrieve the meta-object associated with that object.

Example:

See also
metaObject()

Definition at line 469 of file qobject.h.

◆ qobject_iid_cast() [1/2]

template<class T >
std::enable_if_t<std::is_const<T>::value, T *> qobject_iid_cast ( const QObject object)
inline

Definition at line 494 of file qobject.h.

◆ qobject_iid_cast() [2/2]

template<class T >
T* qobject_iid_cast ( QObject object,
const char *  IId = qobject_interface_iid<T *>() 
)
inline

Definition at line 489 of file qobject.h.

◆ qobject_interface_iid()

template<class T >
constexpr const char* qobject_interface_iid ( )
constexprdelete

◆ qt_qFindChild_helper()

Q_CORE_EXPORT QObject* qt_qFindChild_helper ( const QObject parent,
const QString name,
const QMetaObject mo,
Qt::FindChildOptions  options 
)

Definition at line 2087 of file qobject.cpp.

◆ qt_qFindChildren_helper() [1/3]

Q_CORE_EXPORT void qt_qFindChildren_helper ( const QObject parent,
const QMetaObject mo,
QList< void * > *  list,
Qt::FindChildOptions  options 
)

Definition at line 2050 of file qobject.cpp.

◆ qt_qFindChildren_helper() [2/3]

Q_CORE_EXPORT void qt_qFindChildren_helper ( const QObject parent,
const QRegularExpression re,
const QMetaObject mo,
QList< void * > *  list,
Qt::FindChildOptions  options 
)

◆ qt_qFindChildren_helper() [3/3]

Q_CORE_EXPORT void qt_qFindChildren_helper ( const QObject parent,
const QString name,
const QMetaObject mo,
QList< void * > *  list,
Qt::FindChildOptions  options 
)

Definition at line 2038 of file qobject.cpp.