240717班级,工业化控制系统,煤矿相关行业,昆仑系统
wangky
2024-11-06 1a927fa6b6a1332b38ec3f711fde002f6ec0641d
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
#ifndef QCOMBOXDELEGATE_H
#define QCOMBOXDELEGATE_H
 
#include <QItemDelegate>
#include <QComboBox>
#include <vector>
using namespace std;
 
class QComBoxDelegate : public QItemDelegate
{
 
public:
    QComBoxDelegate();
    QComBoxDelegate(QObject * p=0);
 
 
    // 创建编辑器
    QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
 
    // 显示编辑器,更新几何位置
    void updateEditorGeometry(QWidget *editor, 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;
};
 
#endif // QCOMBOXDELEGATE_H