Revision ed51642b
Von Christian Ehringfeld vor fast 8 Jahren hinzugefügt
src/entityinstancefactory.cpp | ||
---|---|---|
|
||
QSharedPointer<Entity> EntityInstanceFactory::castQVariant(
|
||
QVariant &entity) {
|
||
return *reinterpret_cast<QSharedPointer<Entity>*>(entity.data());
|
||
auto e = entity.value<QSharedPointer<Entity>>();
|
||
if(!e) {
|
||
auto ne = *reinterpret_cast<QSharedPointer<Entity>*>(entity.data());
|
||
if(ne && ne->getClassname() != "Entity") {
|
||
e = ne;
|
||
} else {
|
||
e = QSharedPointer<Entity>();
|
||
}
|
||
}
|
||
return e;
|
||
}
|
||
|
||
QStringList EntityInstanceFactory::getRegisteredClasses() {
|
Auch abrufbar als: Unified diff
fix!?