Revision 55dc7c8e
Von Christian Ehringfeld vor mehr als 7 Jahren hinzugefügt
src/entityinstancefactory.cpp | ||
---|---|---|
|
||
QList<QSharedPointer<Entity>> EntityInstanceFactory::castQVariantList(
|
||
QVariant &list) {
|
||
return *reinterpret_cast<QList<QSharedPointer<Entity>>*>(list.data());
|
||
if(!list.isNull() && list.isValid()) {
|
||
return *reinterpret_cast<QList<QSharedPointer<Entity>>*>(list.data());
|
||
}
|
||
return QList<QSharedPointer<Entity>>();
|
||
}
|
||
|
||
const QSharedPointer<Entity> EntityInstanceFactory::castQVariant(
|
||
QVariant &entity) {
|
||
|
||
return *static_cast<const QSharedPointer<Entity>*>(entity.constData());
|
||
if(!entity.isNull() && entity.isValid()) {
|
||
return *static_cast<const QSharedPointer<Entity>*>(entity.constData());
|
||
}
|
||
return QSharedPointer<Entity>(nullptr);
|
||
}
|
||
|
||
QStringList EntityInstanceFactory::getRegisteredClasses() {
|
Auch abrufbar als: Unified diff
imp