![]() |
Mixxx
|
00001 /* 00002 * controlgroupdelegate.h 00003 * 00004 * Created on: 18-Mar-2009 00005 * Author: asantoni 00006 */ 00007 00008 #ifndef CONTROLGROUPDELEGATE_H_ 00009 #define CONTROLGROUPDELEGATE_H_ 00010 00011 #include <QItemDelegate> 00012 #include <QModelIndex> 00013 #include <QObject> 00014 #include <QSize> 00015 #include <QComboBox> 00016 #include <QLabel> 00017 00018 #define CONTROLGROUP_CHANNEL1_STRING "[Channel1]" 00019 #define CONTROLGROUP_CHANNEL2_STRING "[Channel2]" 00020 #define CONTROLGROUP_SAMPLER1_STRING "[Sampler1]" 00021 #define CONTROLGROUP_SAMPLER2_STRING "[Sampler2]" 00022 #define CONTROLGROUP_SAMPLER3_STRING "[Sampler3]" 00023 #define CONTROLGROUP_SAMPLER4_STRING "[Sampler4]" 00024 #define CONTROLGROUP_MASTER_STRING "[Master]" 00025 #define CONTROLGROUP_PLAYLIST_STRING "[Playlist]" 00026 #define CONTROLGROUP_FLANGER_STRING "[Flanger]" 00027 #define CONTROLGROUP_MICROPHONE_STRING "[Microphone]" 00028 00029 class ControlGroupDelegate : public QItemDelegate 00030 { 00031 Q_OBJECT 00032 00033 public: 00034 ControlGroupDelegate(QObject *parent = 0); 00035 00036 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, 00037 const QModelIndex &index) const; 00038 void paint(QPainter *painter, const QStyleOptionViewItem &option, 00039 const QModelIndex &index) const; 00040 void setEditorData(QWidget *editor, const QModelIndex &index) const; 00041 void setModelData(QWidget *editor, QAbstractItemModel *model, 00042 const QModelIndex &index) const; 00043 00044 void updateEditorGeometry(QWidget *editor, 00045 const QStyleOptionViewItem &option, const QModelIndex &index) const; 00047 static QStringList getControlGroups() { return m_controlGroups; }; 00048 00049 private: 00050 static QStringList m_controlGroups; 00051 00052 }; 00053 00054 #endif /* CONTROLGROUPDELEGATE_H_ */