-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitemtypedelegate.h
More file actions
26 lines (19 loc) · 966 Bytes
/
itemtypedelegate.h
File metadata and controls
26 lines (19 loc) · 966 Bytes
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
// itemtypedelegate.h
#ifndef ITEMTYPEDELEGATE_H
#define ITEMTYPEDELEGATE_H
#include <QStyledItemDelegate> // QStyledItemDelegate is often preferred over QItemDelegate
#include "trackingcommon.h" // For ItemType and helper functions
class ItemTypeDelegate : public QStyledItemDelegate {
Q_OBJECT
public:
explicit ItemTypeDelegate(QObject *parent = nullptr);
// Override functions for custom editing
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const override;
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
};
#endif // ITEMTYPEDELEGATE_H