Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 75cecd67

Von Christian Ehringfeld vor mehr als 7 Jahren hinzugefügt

  • ID 75cecd6788d56ed391e44e354609ec91116335db
  • Vorgänger 638e5843
  • Nachfolger 949b3ea3

hmm

Unterschiede anzeigen:

src/entityhelper.cpp
void EntityHelper::setListProperty(const QSharedPointer<Entity> &entity,
QList<QSharedPointer<Entity>> &list,
const QMetaProperty &property) {
QVariant var;
var.setValue<QList<QSharedPointer<Entity>>>(list);
entity->setProperty(property.name(),var);
if(!list.isEmpty()) {
auto instance = EntityInstanceFactory::createInstance(list.at(0)->getClassname());
instance->setAsListProperty(entity, list, property);
}
property.reset(entity.data());
}
void EntityHelper::addEntityToListProperty(const QSharedPointer<Entity>
......
var) : QList<QSharedPointer<Entity>>());
if (!list.contains(add)) {
list.append(add);
entity->setListProperty(list,property);
EntityHelper::setListProperty(entity, list, property);
}
}
......
break;
}
}
entity->setListProperty(list,property);
EntityHelper::setListProperty(entity, list, property);
}
}
......
if (var.canConvert<QList<QVariant>>()) {
auto list = EntityInstanceFactory::castQVariantList(var);
list.clear();
entity->setListProperty(list,property);
EntityHelper::setListProperty(entity, list, property);
}
}

Auch abrufbar als: Unified diff