Revision 51f88a34
Von Christian Ehringfeld vor mehr als 7 Jahren hinzugefügt
src/entity.h | ||
---|---|---|
void idChanged();
|
||
|
||
#define EM_MACRO(type) \
|
||
virtual void setListProperty(QList<QSharedPointer<Entity>> &entList, const QMetaProperty &property) override { \
|
||
virtual void setListProperty(const QSharedPointer<Entity> &e,QList<QSharedPointer<Entity>> &entList, const QMetaProperty &property) override { \
|
||
QList<QSharedPointer<type>> list = *reinterpret_cast<QList<QSharedPointer<type>>*>(&entList); \
|
||
QVariant var; \
|
||
var.setValue<QList<QSharedPointer<type>>>(list); \
|
||
property.write(this, var); \
|
||
property.write(e.data(), var); \
|
||
} \
|
||
virtual void setProperty(QSharedPointer<Entity> &entity, const QMetaProperty &property) override { \
|
||
QSharedPointer<type> e = *reinterpret_cast<QSharedPointer<type>*>(&entity); \
|
||
virtual void setProperty(const QSharedPointer<Entity> &e,QSharedPointer<Entity> &value, const QMetaProperty &property) override { \
|
||
QSharedPointer<type> en = *reinterpret_cast<QSharedPointer<type>*>(&value); \
|
||
QVariant var; \
|
||
var.setValue<QSharedPointer<type>>(e); \
|
||
property.write(this, var); \
|
||
var.setValue<QSharedPointer<type>>(en); \
|
||
property.write(e.data(), var); \
|
||
}
|
||
|
||
//#define EM_PROPERTY(type,attribute,getter,setter)
|
||
... | ... | |
QList<ErrorMsg> getErrors() const;
|
||
QString getErrorsAsString() const;
|
||
void setErrors(const QList<ErrorMsg> &value);
|
||
virtual void setListProperty(QList<QSharedPointer<Entity>> &entList,
|
||
virtual void setListProperty(const QSharedPointer<Entity> &e, QList<QSharedPointer<Entity>> &entList,
|
||
const QMetaProperty &property) = 0;
|
||
virtual void setProperty(QSharedPointer<Entity> &entity, const QMetaProperty &property) = 0;
|
||
virtual void setProperty(const QSharedPointer<Entity> &e, QSharedPointer<Entity> &value, const QMetaProperty &property) = 0;
|
||
|
||
protected:
|
||
explicit Entity (QObject *parent = 0);
|
Auch abrufbar als: Unified diff
some progress