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,
52 explicit MetadataModel(QObject *parent = 0);
55 Q_INVOKABLE
int rowCount(
const QModelIndex &parent = QModelIndex())
const;
56 QVariant data(
const QModelIndex &index,
int role)
const;
57 bool setData(
const QModelIndex &index,
const QVariant &value,
int role);
58 QHash<int, QByteArray> roleNames()
const;
59 Qt::ItemFlags flags(
const QModelIndex &index)
const;
62 void add(QmlMetadata* data);
63 Q_INVOKABLE QmlMetadata* get(
int index)
const;
64 MetadataFilter filter()
const {
return m_filter; }
65 void setFilter(MetadataFilter);
66 QString search()
const {
return m_search; }
67 void setSearch(
const QString& search);
68 Q_INVOKABLE
bool isVisible(
int row)
const;
69 void setIsClipProducer(
bool isClipProducer);
76 typedef QList<QmlMetadata*> MetadataList;
78 MetadataFilter m_filter;
79 bool m_isClipProducer;
83 #endif // METADATAMODEL_H