Beispiel #1
0
 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);
 }
Beispiel #3
0
 void setEditorData(QWidget *editor, const QModelIndex &index) const
 {
     IntegerWatchLineEdit *lineEdit = qobject_cast<IntegerWatchLineEdit *>(editor);
     QTC_ASSERT(lineEdit, return);
     lineEdit->setModelData(index.data(Qt::EditRole));
 }