GammaRay API Documentation  2.7.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GammaRay::MetaObject Class Referenceabstract

Compile-time introspection adaptor for non-QObject classes. More...

#include <metaobject.h>

Inheritance diagram for GammaRay::MetaObject:
Inheritance graph
[legend]

Public Member Functions

void addBaseClass (MetaObject *baseClass)
 
void addProperty (MetaProperty *property)
 
void * castForPropertyAt (void *object, int index) const
 
void * castTo (void *object, const QString &baseClass) const
 
QString className () const
 Returns the name of the class represented by this object.
 
bool inherits (const QString &className) const
 
MetaPropertypropertyAt (int index) const
 
int propertyCount () const
 
void setClassName (const QString &className)
 
MetaObjectsuperClass (int index=0) const
 

Protected Member Functions

virtual void * castToBaseClass (void *object, int baseClassIndex) const =0
 

Protected Attributes

QVector< MetaObject * > m_baseClasses
 

Detailed Description

Compile-time introspection adaptor for non-QObject classes.

Member Function Documentation

void GammaRay::MetaObject::addBaseClass ( MetaObject baseClass)

Add a base class meta object.

void GammaRay::MetaObject::addProperty ( MetaProperty property)

Add a property for this class. This transfers ownership.

void* GammaRay::MetaObject::castForPropertyAt ( void *  object,
int  index 
) const

Casts a void pointer for an instance of this type to one appropriate for use with the property at index index. Make sure to use this when dealing with multi-inheritance.

void* GammaRay::MetaObject::castTo ( void *  object,
const QString baseClass 
) const

Casts to a void pointer for an instance of this type to one referring to the given base class type. If baseClass is not a base class of this type, nullptr is returned.

virtual void* GammaRay::MetaObject::castToBaseClass ( void *  object,
int  baseClassIndex 
) const
protectedpure virtual

Casts down to base class baseClassIndex. This is important when traversing multi-inheritance trees.

Implemented in GammaRay::MetaObjectImpl< T, Base1, Base2, Base3 >.

MetaProperty* GammaRay::MetaObject::propertyAt ( int  index) const

Returns the property adaptor for index index.

int GammaRay::MetaObject::propertyCount ( ) const

Returns the amount of properties available in this class (including base classes).


Klarälvdalens Datakonsult AB (KDAB)
"The Qt Experts"
https://www.kdab.com/
GammaRay
Qt-application inspection and manipulation tool
https://www.kdab.com/gammaray/