mirror of
https://github.com/hasherezade/pe-bear
synced 2026-08-22 22:29:04 -04:00
[BUGFIX] In HexEdit: advance to edit the next field only if the current field was modified. Removed dead code
This commit is contained in:
parent
8f7c13ee61
commit
7acf694ff7
2 changed files with 6 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue