forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrolgroupdelegate.h
56 lines (46 loc) · 1.71 KB
/
controlgroupdelegate.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
51
52
53
54
55
56
/*
* controlgroupdelegate.h
*
* Created on: 18-Mar-2009
* Author: asantoni
*/
#ifndef CONTROLGROUPDELEGATE_H_
#define CONTROLGROUPDELEGATE_H_
#include <QAbstractItemModel>
#include <QItemDelegate>
#include <QModelIndex>
#include <QObject>
#include <QPainter>
#include <QStringList>
#include <QStyleOptionViewItem>
#include <QWidget>
#define CONTROLGROUP_CHANNEL1_STRING "[Channel1]"
#define CONTROLGROUP_CHANNEL2_STRING "[Channel2]"
#define CONTROLGROUP_SAMPLER1_STRING "[Sampler1]"
#define CONTROLGROUP_SAMPLER2_STRING "[Sampler2]"
#define CONTROLGROUP_SAMPLER3_STRING "[Sampler3]"
#define CONTROLGROUP_SAMPLER4_STRING "[Sampler4]"
#define CONTROLGROUP_MASTER_STRING "[Master]"
#define CONTROLGROUP_PLAYLIST_STRING "[Playlist]"
#define CONTROLGROUP_FLANGER_STRING "[Flanger]"
#define CONTROLGROUP_MICROPHONE_STRING "[Microphone]"
class ControlGroupDelegate : public QItemDelegate
{
Q_OBJECT
public:
ControlGroupDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &index) const;
/** This getter is used by the "Add Control" GUI */
static QStringList getControlGroups() { return m_controlGroups; };
private:
static QStringList m_controlGroups;
};
#endif /* CONTROLGROUPDELEGATE_H_ */