Revision f5087482
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
src/entityinstancefactory.cpp | ||
---|---|---|
|
||
Entity *EntityInstanceFactory::createInstance(int metaTypeId) {
|
||
Entity *e = 0;
|
||
if (metaTypeId != -1) {
|
||
if (metaTypeId != QMetaType::UnknownType) {
|
||
e = static_cast<Entity *>(QMetaType::create(metaTypeId));
|
||
}
|
||
if(!e) {
|
||
qDebug() << "Entity instance could not created!";
|
||
throw -2; //testing
|
||
}
|
||
} else {
|
||
qDebug() << metaTypeId <<" is NOT registered! Please register it!";
|
||
throw -1; //testing
|
||
}
|
||
return e;
|
||
}
|
||
|
||
... | ... | |
Entity *super = 0;
|
||
if (e) {
|
||
auto metaObject = e->metaObject()->superClass();
|
||
if (QString(metaObject->className()) != QString("Entity")) {
|
||
if (QString(metaObject->className()) != QString("CuteEntityManager::Entity")) {
|
||
super = EntityInstanceFactory::createInstance(metaObject->className());
|
||
}
|
||
}
|
Auch abrufbar als: Unified diff
some sql and inheritance stuff,debugging entityinstancefactory