コード例 #1
0
ファイル: registerwindow.cpp プロジェクト: pcacjr/qt-creator
 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());
 }
コード例 #2
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);
     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);
 }