1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| #ifndef COMBOBOXDELEGATE_H
| #define COMBOBOXDELEGATE_H
|
| #include <QItemDelegate>
| #include <QComboBox>
|
|
| class ComboBoxDelegate : public QItemDelegate
| {
| public:
| ComboBoxDelegate(QStringList labels,QObject *parent=0,bool edit=false);
|
| QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
| void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
|
| private:
| QStringList m_labels;
| bool m_edit;
| };
|
| #endif // COMBOBOXDELEGATE_H
|
|