[BUGFIX] In HexEdit: advance to edit the next field only if the current field was modified. Removed dead code

This commit is contained in:
hasherezade 2026-06-04 20:50:59 +02:00
parent 8f7c13ee61
commit 7acf694ff7
2 changed files with 6 additions and 12 deletions

View file

@ -82,15 +82,6 @@ HexItemDelegate::HexItemDelegate(QObject* parent) :
#endif
}
void HexItemDelegate::selectNextParentItem(const QModelIndex &index) const
{
QTableView *parentView = qobject_cast<QTableView*>(this->parent());
if (!parentView) return;
parentView->setCurrentIndex(index);
parentView->edit(index);
}
QWidget* HexItemDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
@ -129,9 +120,14 @@ QWidget* HexItemDelegate::createEditor(QWidget *parent,
void HexItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex& index) const
{
const QString before = model->data(index, Qt::EditRole).toString();
QStyledItemDelegate::setModelData(editor, model, index);
emit dataSet(index.column(), index.row());
const QString after = model->data(index, Qt::EditRole).toString();
if (before != after) {
emit dataSet(index.column(), index.row());
}
}
void HexItemDelegate::paint(QPainter* painter,
const QStyleOptionViewItem& option,
const QModelIndex& index) const

View file

@ -40,8 +40,6 @@ Q_SIGNALS:
void dataSet(int col, int row) const;
private:
void selectNextParentItem(const QModelIndex &index) const;
QColor m_selectionBgColor, m_selectionTextColor;
QRegularExpressionValidator validator;
};