-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparamsmodel.h
More file actions
60 lines (46 loc) · 1.7 KB
/
Copy pathparamsmodel.h
File metadata and controls
60 lines (46 loc) · 1.7 KB
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
51
52
53
54
55
56
57
58
59
60
#ifndef PARAMSMODEL_H
#define PARAMSMODEL_H
#include <QAbstractItemModel>
#include <QList>
#include <QHash>
#include "parameter.h"
typedef struct _Menu menu_t;
typedef struct _MenuItem menu_item_t;
typedef struct _MenuValue menu_value_t;
class ParamsModel
:public QAbstractItemModel
{
Q_OBJECT
public:
explicit ParamsModel(QObject *parent = 0);
~ParamsModel();
QVariant data(const QModelIndex &index, int role) const;
bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
Parameter* parameter(const QModelIndex& index);
const Parameter* parameter(const QModelIndex& index) const;
menu_value_t* menuValue(const QModelIndex& index);
const menu_value_t* menuValue(const QModelIndex& index) const;
QList<Parameter*> getParamsList();
QList<Parameter*> getRealParamsList();
QHash<param_id_t, Parameter*> getParamsHash();
QHash<param_id_t, Parameter*> getRealParamsHash();
signals:
public slots:
void applyDefault();
void paramsUpdated();
private:
menu_t* params_menu;
menu_item_t* params_items;
QString getItemName(menu_item_t* item, Parameter* param) const;
void setupParams();
void cleanUpParams();
};
#endif // PARAMSMODEL_H