forked from epasveer/seer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQEditDelegate.cpp
33 lines (23 loc) · 926 Bytes
/
QEditDelegate.cpp
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
30
31
32
#include "QEditDelegate.h"
//
// QAllowEditDelegate enables a custom editor for a QTreeView column.
//
QAllowEditDelegate::QAllowEditDelegate(QObject* parent) : QStyledItemDelegate(parent) {
}
void QAllowEditDelegate::setModelData (QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const {
emit editingStarted(index);
QStyledItemDelegate::setModelData(editor, model, index);
emit editingFinished(index);
}
//
// QNoEditDelegate disables editing in a QTreeView for a column.
// It does this by returning a 'null' editor when QTreeView calls QStyledItemDelegate::createEditor() for the cell.
//
QNoEditDelegate::QNoEditDelegate(QObject* parent) : QStyledItemDelegate(parent) {
}
QWidget* QNoEditDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const {
Q_UNUSED(parent);
Q_UNUSED(option);
Q_UNUSED(index);
return 0;
}