-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmicmodel.h
50 lines (38 loc) · 1.12 KB
/
micmodel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef MICMODEL_H
#define MICMODEL_H
#include <QObject>
#include <QAbstractListModel>
#include <QStringList>
#include <QDir>
#include <QUrl>
#include <QDateTime>
#include <QDebug>
#include "config.h"
class MicModel : public QAbstractListModel
{
Q_OBJECT
public:
enum MicRoles {
xRole = Qt::UserRole + 1,
yRole,
zRole
};
MicModel(Config * config, QObject *parent = 0);
void addMic(const Mic &mic);
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
Q_INVOKABLE QString ownData(const int index, QString role) const;
Q_INVOKABLE bool setOwnData(const int index, const QString &value, QString role);
Qt::ItemFlags flags(const QModelIndex &index) const;
Q_INVOKABLE bool append(const QModelIndex &parent = QModelIndex());
Q_INVOKABLE bool remove(const QModelIndex &parent = QModelIndex());
signals:
void micsChanged();
public slots:
protected:
QHash<int, QByteArray> roleNames() const;
private:
Config * c;
QList<Mic> m_mics;
};
#endif // MICMODEL_H