-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy_item_delegate.hpp
More file actions
28 lines (21 loc) · 1.3 KB
/
proxy_item_delegate.hpp
File metadata and controls
28 lines (21 loc) · 1.3 KB
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
#pragma once
#include <QAbstractItemDelegate>
class ProxyItemDelegate : public QAbstractItemDelegate
{
using TBase = QAbstractItemDelegate;
public:
ProxyItemDelegate(QAbstractItemDelegate * delegate, QObject * parent);
void paint(QPainter * painter, QStyleOptionViewItem const & option, QModelIndex const & index) const;
QSize sizeHint(QStyleOptionViewItem const & option, QModelIndex const & index) const;
QWidget * createEditor(QWidget * parent, QStyleOptionViewItem const & option, QModelIndex const & index) const;
void destroyEditor(QWidget * editor, QModelIndex const & index) const;
void setEditorData(QWidget * editor, QModelIndex const & index) const;
void setModelData(QWidget * editor, QAbstractItemModel * model, QModelIndex const & index) const;
void updateEditorGeometry(QWidget * editor, QStyleOptionViewItem const & option, QModelIndex const & index) const;
bool editorEvent(QEvent * event, QAbstractItemModel * model, QStyleOptionViewItem const & option, QModelIndex const & index);
bool helpEvent(QHelpEvent * event, QAbstractItemView * view, QStyleOptionViewItem const & option, QModelIndex const & index);
QVector<int> paintingRoles() const;
private:
QAbstractItemDelegate * m_delegate;
void initStyleOption(QStyleOptionViewItem * option, const QModelIndex & index) const;
};