![]() |
Mixxx
|
00001 /* 00002 * controlvaluedelegate.h 00003 * 00004 * Created on: 18-Mar-2009 00005 * Author: asantoni 00006 */ 00007 00008 #ifndef CONTROLVALUEDELEGATE_H_ 00009 #define CONTROLVALUEDELEGATE_H_ 00010 00011 #include <QItemDelegate> 00012 #include <QModelIndex> 00013 #include <QObject> 00014 #include <QSize> 00015 #include <QComboBox> 00016 #include <QLabel> 00017 00018 class ControlValueDelegate : public QItemDelegate 00019 { 00020 Q_OBJECT 00021 00022 public: 00023 ControlValueDelegate(QObject *parent = 0); 00024 00025 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, 00026 const QModelIndex &index) const; 00027 void paint(QPainter *painter, const QStyleOptionViewItem &option, 00028 const QModelIndex &index) const; 00029 void setEditorData(QWidget *editor, const QModelIndex &index) const; 00030 void setModelData(QWidget *editor, QAbstractItemModel *model, 00031 const QModelIndex &index) const; 00032 00033 void updateEditorGeometry(QWidget *editor, 00034 const QStyleOptionViewItem &option, const QModelIndex &index) const; 00035 00036 static bool verifyControlValueValidity(QString controlGroup, QAbstractItemModel *model, 00037 const QModelIndex &index); 00039 static QStringList getChannelControlValues() { return m_channelControlValues; }; 00040 static QStringList getMasterControlValues() { return m_masterControlValues; }; 00041 static QStringList getPlaylistControlValues() { return m_playlistControlValues; }; 00042 static QStringList getFlangerControlValues() { return m_flangerControlValues; }; 00043 static QStringList getMicrophoneControlValues() { return m_microphoneControlValues; }; 00044 private: 00045 static QStringList m_channelControlValues; 00046 static QStringList m_masterControlValues; 00047 static QStringList m_playlistControlValues; 00048 static QStringList m_flangerControlValues; 00049 static QStringList m_microphoneControlValues; 00050 }; 00051 00052 #endif /* CONTROLVALUEDELEGATE_H_ */