GammaRay  2.2.0
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Classes | Namespaces | Macros
metaobjectrepository.h File Reference

MetaObject repository macros. More...

#include "gammaray_core_export.h"
#include <QHash>

Go to the source code of this file.

Classes

class  GammaRay::MetaObjectRepository
 MetaObject repository. More...
 

Namespaces

namespace  GammaRay
 

Macros

#define MO_ADD_BASECLASS(Base)
 
#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)
 

Detailed Description

MetaObject repository macros.

Macro Definition Documentation

#define MO_ADD_BASECLASS (   Base)
Value:
Q_ASSERT(GammaRay::MetaObjectRepository::instance()->hasMetaObject(QLatin1String(#Base))); \
mo->addBaseClass(GammaRay::MetaObjectRepository::instance()->metaObject(QLatin1String(#Base)));
#define MO_ADD_METAOBJECT0 (   Class)
Value:
mo->setClassName(QLatin1String(#Class)); \
GammaRay::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->setClassName(QLatin1String(#Class)); \
MO_ADD_BASECLASS(Base1) \
GammaRay::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->setClassName(QLatin1String(#Class)); \
MO_ADD_BASECLASS(Base1) \
MO_ADD_BASECLASS(Base2) \
GammaRay::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:
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:
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:
QLatin1String(#Getter), \
&Class::Getter));

Register a read-only property for class Class.


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