FACT++  1.0
bool CheckBoxDelegate::editorEvent ( QEvent *  evt,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)

Definition at line 56 of file CheckBoxDelegate.cc.

58 {
59  QStandardItemModel *it = dynamic_cast<QStandardItemModel*>(model);
60  if (!it)
61  return QStyledItemDelegate::editorEvent(evt, model, option, index);
62 
63  const QStandardItem *item = it->itemFromIndex(index);
64  if (!item)
65  return QStyledItemDelegate::editorEvent(evt, model, option, index);
66 
67  const Qt::CheckState before = item->checkState();
68 
69  const bool rc = QStyledItemDelegate::editorEvent(evt, model, option, index);
70 
71  const Qt::CheckState after = item->checkState();
72 
73  if (before!=after)
74  QApplication::sendEvent(it->parent(), new CheckBoxEvent(*item));
75 
76  return rc;
77 }
Definition: did.h:42
An event posted by the CheckBoxDelegate if the CheckBox is used.