18 #ifndef METADATAMODEL_H
19 #define METADATAMODEL_H
21 #include <QAbstractListModel>
26 class MetadataModel :
public QAbstractListModel
29 Q_ENUMS(MetadataFilter)
30 Q_PROPERTY(MetadataFilter filter READ filter WRITE setFilter NOTIFY filterChanged)
31 Q_PROPERTY(QString search READ search WRITE setSearch NOTIFY searchChanged)
36 NameRole = Qt::UserRole + 1,
55 HiddenMaskBit = 1 << 0,
56 clipOnlyMaskBit = 1 << 1,
57 gpuIncompatibleMaskBit = 1 << 2,
58 gpuAlternativeMaskBit = 1 << 3,
59 needsGPUMaskBit = 1 << 4,
63 explicit MetadataModel(QObject *parent = 0);
66 Q_INVOKABLE
int rowCount(
const QModelIndex &parent = QModelIndex())
const;
67 QVariant data(
const QModelIndex &index,
int role)
const;
68 bool setData(
const QModelIndex &index,
const QVariant &value,
int role);
69 QHash<int, QByteArray> roleNames()
const;
70 Qt::ItemFlags flags(
const QModelIndex &index)
const;
73 void add(QmlMetadata *data);
74 Q_INVOKABLE QmlMetadata *get(
int index)
const;
75 MetadataFilter filter()
const
79 void setFilter(MetadataFilter);
80 QString search()
const
84 void setSearch(
const QString &search);
85 Q_INVOKABLE
bool isVisible(
int row)
const;
86 void setIsClipProducer(
bool isClipProducer);
87 void setIsChainProducer(
bool isChainProducer);
94 typedef QList<QmlMetadata *> MetadataList;
96 MetadataFilter m_filter;
97 bool m_isClipProducer;
98 bool m_isChainProducer;
100 unsigned m_filterMask;
102 unsigned computeFilterMask(
const QmlMetadata *meta);