MetaObject repository macros.
More...
#include "gammaray_core_export.h"
#include <QHash>
Go to the source code of this file.
|
#define | MO_ADD_METAOBJECT0(Class) |
|
#define | MO_ADD_METAOBJECT1(Class, Base1) |
|
#define | MO_ADD_METAOBJECT2(Class, Base1, Base2) |
|
#define | MO_ADD_PROPERTY(Class, Type, Getter, Setter) |
|
#define | MO_ADD_PROPERTY_CR(Class, Type, Getter, Setter) |
|
#define | MO_ADD_PROPERTY_RO(Class, Type, Getter) |
|
MetaObject repository macros.
#define MO_ADD_METAOBJECT0 |
( |
|
Class) | |
|
Value:mo = new MetaObjectImpl<Class>; \
mo->setClassName(QLatin1String(#Class)); \
MetaObjectRepository::instance()->addMetaObject(mo);
Register Class
with the MetaObjectRepository. Use this if Class
has no base class.
#define MO_ADD_METAOBJECT1 |
( |
|
Class, |
|
|
|
Base1 |
|
) |
| |
Value:mo = new MetaObjectImpl<Class, Base1>; \
mo->setClassName(QLatin1String(#Class)); \
MO_ADD_BASECLASS(Base1) \
MetaObjectRepository::instance()->addMetaObject(mo);
Register Class
with the MetaObjectRepository. Use this if Class
has one base class.
#define MO_ADD_METAOBJECT2 |
( |
|
Class, |
|
|
|
Base1, |
|
|
|
Base2 |
|
) |
| |
Value:mo = new MetaObjectImpl<Class, Base1, Base2>; \
mo->setClassName(QLatin1String(#Class)); \
MO_ADD_BASECLASS(Base1) \
MO_ADD_BASECLASS(Base2) \
MetaObjectRepository::instance()->addMetaObject(mo);
Register Class
with the MetaObjectRepository. Use this if Class
has two base classes.
#define MO_ADD_PROPERTY |
( |
|
Class, |
|
|
|
Type, |
|
|
|
Getter, |
|
|
|
Setter |
|
) |
| |
Value:mo->addProperty(new MetaPropertyImpl<Class, Type>( \
QLatin1String(#Getter), \
&Class::Getter, \
static_cast<void (Class::*)(Type)>(&Class::Setter)) \
);
Register a read/write property for class Class
.
#define MO_ADD_PROPERTY_CR |
( |
|
Class, |
|
|
|
Type, |
|
|
|
Getter, |
|
|
|
Setter |
|
) |
| |
Value:mo->addProperty(new MetaPropertyImpl<Class, Type, const Type&>( \
QLatin1String(#Getter), \
&Class::Getter, \
static_cast<void (Class::*)(const Type&)>(&Class::Setter)) \
);
Register a read/write property for class Class
with a type that is passed as const reference.
#define MO_ADD_PROPERTY_RO |
( |
|
Class, |
|
|
|
Type, |
|
|
|
Getter |
|
) |
| |
Value:mo->addProperty(new MetaPropertyImpl<Class, Type>( \
QLatin1String(#Getter), \
&Class::Getter));
Register a read-only property for class Class
.