15 #include "AssetsManager.h"
20 #define PROPERTY_COUNT 20
45 getManager()->archetypes()->each([
this, resourcesManager] (archetype *arch) {
46 if (QUERY_FLAG(&arch->clone, FLAG_MONSTER) && (!arch->head)) {
47 myMonsters.push_back(resourcesManager->wrap(&arch->clone, nullptr));
66 if (role != Qt::DisplayRole && role != Qt::EditRole) {
70 return monster->property(
properties[index.column()]);
74 if (orientation == Qt::Vertical) {
75 if (role == Qt::DisplayRole) {
77 }
else if (role == Qt::DecorationRole) {
83 if (role != Qt::DisplayRole) {
84 return QAbstractTableModel::headerData(section, orientation, role);
90 if (!index.isValid()) {
91 return Qt::NoItemFlags;
95 return QAbstractItemModel::flags(index);
98 Qt::ItemFlags
flags = QAbstractItemModel::flags(index);
100 int pi = ObjectWrapper::staticMetaObject.indexOfProperty(
properties[index.column()]);
101 if (pi != -1 && ObjectWrapper::staticMetaObject.property(pi).isWritable()) {
102 flags |= Qt::ItemIsEditable;
108 if (role != Qt::EditRole)
112 monster->setProperty(
properties[index.column()], value);