GammaRay API Documentation
2.7.0
|
Compile-time introspection adaptor for non-QObject classes. More...
#include <metaobject.h>
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 |
MetaProperty * | propertyAt (int index) const |
int | propertyCount () const |
void | setClassName (const QString &className) |
MetaObject * | superClass (int index=0) const |
Protected Member Functions | |
virtual void * | castToBaseClass (void *object, int baseClassIndex) const =0 |
Protected Attributes | |
QVector< MetaObject * > | m_baseClasses |
Compile-time introspection adaptor for non-QObject classes.
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.
|
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).