debugger: fix hex input when changing register values

Change-Id: I198e1631d488aff9250e3438ed2fade5aa89968b
Reviewed-on: http://codereview.qt-project.org/4888
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-09-14 13:00:58 +02:00
committed by hjk
parent ce9ea72c67
commit a67d8205b1
2 changed files with 6 additions and 9 deletions

View File

@@ -111,7 +111,11 @@ public:
return;
IntegerWatchLineEdit *lineEdit = qobject_cast<IntegerWatchLineEdit*>(editor);
QTC_ASSERT(lineEdit, return);
currentEngine()->setRegisterValue(index.row(), lineEdit->text());
const int base = currentHandler()->numberBase();
QString value = lineEdit->text();
if (base == 16 && !value.startsWith("0x"))
value = "0x" + value;
currentEngine()->setRegisterValue(index.row(), value);
}
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,