Revision ca25da8b
Von Christian Ehringfeld vor etwa 9 Jahren hinzugefügt
src/entityinstancefactory.cpp | ||
---|---|---|
if (metaTypeId != QMetaType::UnknownType) {
|
||
auto metaObject = QMetaType::metaObjectForType(metaTypeId);
|
||
if (metaObject) {
|
||
e = qobject_cast<Entity *>(metaObject->newInstance());
|
||
e = qobject_cast<Entity *>(EntityInstanceFactory::createObject(metaObject->className()));
|
||
if(!e) {
|
||
e = qobject_cast<Entity *>(metaObject->newInstance());
|
||
qDebug() << "Backup method for dynamic object creation was called. Maybe the class " +
|
||
metaObject->className()+"isn't registered?";
|
||
}
|
||
} else {
|
||
void *newObj = QMetaType::create(metaTypeId);
|
||
if (newObj) {
|
||
... | ... | |
}
|
||
}
|
||
|
||
QList<QSharedPointer<Entity> > EntityInstanceFactory::castQVariantList(
|
||
QVariant &list) {
|
||
QList<QSharedPointer<Entity>> EntityInstanceFactory::castQVariantList(
|
||
QVariant &list) {
|
||
return *reinterpret_cast<QList<QSharedPointer<Entity>>*>(list.data());
|
||
}
|
||
|
Auch abrufbar als: Unified diff
small fix