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,
53 HiddenMaskBit = 1 << 0,
54 clipOnlyMaskBit = 1 << 1,
55 gpuIncompatibleMaskBit = 1 << 2,
56 gpuAlternativeMaskBit = 1 << 3,
57 needsGPUMaskBit = 1 << 4,
60 explicit MetadataModel(QObject *parent = 0);
63 Q_INVOKABLE
int rowCount(
const QModelIndex &parent = QModelIndex())
const;
64 QVariant data(
const QModelIndex &index,
int role)
const;
65 bool setData(
const QModelIndex &index,
const QVariant &value,
int role);
66 QHash<int, QByteArray> roleNames()
const;
67 Qt::ItemFlags flags(
const QModelIndex &index)
const;
70 void add(QmlMetadata* data);
71 Q_INVOKABLE QmlMetadata* get(
int index)
const;
72 MetadataFilter filter()
const {
return m_filter; }
73 void setFilter(MetadataFilter);
74 QString search()
const {
return m_search; }
75 void setSearch(
const QString& search);
76 Q_INVOKABLE
bool isVisible(
int row)
const;
77 void setIsClipProducer(
bool isClipProducer);
84 typedef QList<QmlMetadata*> MetadataList;
86 MetadataFilter m_filter;
87 bool m_isClipProducer;
89 unsigned m_filterMask;
91 unsigned computeFilterMask(
const QmlMetadata* meta);