void setModelData(QWidget *editor, QAbstractItemModel *, const QModelIndex &index) const { if (index.column() != 1) return; IntegerWatchLineEdit *lineEdit = qobject_cast<IntegerWatchLineEdit*>(editor); QTC_ASSERT(lineEdit, return); currentEngine()->setRegisterValue(index.row(), lineEdit->text()); }
void setModelData(QWidget *editor, QAbstractItemModel *, const QModelIndex &index) const { if (index.column() != 1) return; IntegerWatchLineEdit *lineEdit = qobject_cast<IntegerWatchLineEdit*>(editor); QTC_ASSERT(lineEdit, return); const int base = currentHandler()->numberBase(); QString value = lineEdit->text(); if (base == 16 && !value.startsWith(QLatin1String("0x"))) value.insert(0, QLatin1String("0x")); currentEngine()->setRegisterValue(index.row(), value); }