Create a custom delegate and emit signals from:
- QAbstractItemDelegate::setEditorData() (edit begins)
- QAbstractItemDelegate::setModelData() (edit ends)
You can easily achieve this by subclassing the default delegate implementation QItemDelegate, adding a couple of signals, overriding methods listed above and emitting corresponding signals from there.
void MyItemDelegate
::setEditorData(QWidget* editor,
const QModelIndex
& index
) const {
emit editBegins();
}
{
emit editEnds();
}
void MyItemDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const
{
QItemDelegate::setEditorData(editor, index);
emit editBegins();
}
void MyItemDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
{
QItemDelegate::setModelData(editor, model, index);
emit editEnds();
}
To copy to clipboard, switch view to plain text mode
Bookmarks