21#ifndef ENTITYMETADATA_H
22#define ENTITYMETADATA_H
26#include <Kanoop/kanoopcommon.h>
28class EntityMetadataInfo;
42 _type(0), _iconId(0) {}
76 int type()
const {
return _type; }
88 int iconId()
const {
return _iconId; }
109 bool hasData(
int role)
const {
return _data.contains(role); }
127 QVariant
toVariant()
const {
return QVariant::fromValue<EntityMetadata>(*
this); }
176 static QString
getMimeTypeString(
int type) {
return QString(
"application-epcpower/%1").arg(getTypeString(type)); }
180 void resolveIconId();
183 QMap<int, QVariant> _data;
186 static QMap<int, EntityMetadataInfo*> _registeredTypes;
187 static QMap<QString, int> _nameToTypeMap;
205 if(metadata.type() == type) {
206 result.append(metadata);
216 QVariant
toVariant()
const {
return QVariant::fromValue<EntityMetadataList>(*
this); }
ModelRole
Model roles extending Qt::UserRole for use in AbstractItemModel subclasses.
@ DataRole
Primary data payload role.
@ UUidRole
Role carrying a QUuid.