From: hjk Date: Thu, 17 Mar 2011 18:37:07 +0000 (+0100) Subject: debugger: fix removal of dummy watch item using the key X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b1d255efeb17e7f1cf38d213a59b086747b2cee2;p=qt-creator-jp%2Fqt-creator-jp.git debugger: fix removal of dummy watch item using the key --- diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 3a9e6b4690..c7ba8834b6 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -214,6 +214,7 @@ enum ModelRoles LocalsEditTypeRole, // A QVariant::type describing the item LocalsIntegerBaseRole, // Number base 16, 10, 8, 2 LocalsExpressionRole, + LocalsRawExpressionRole, LocalsExpandedRole, // The preferred expanded state to the view LocalsTypeFormatListRole, LocalsTypeFormatRole, // Used to communicate alternative formats to the view diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 2fe3481810..f7826ccd28 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -682,6 +682,9 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const case LocalsExpressionRole: return QVariant(expression(item)); + case LocalsRawExpressionRole: + return data.exp; + case LocalsINameRole: return data.iname; diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index eb93669700..1632e65563 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -191,7 +191,7 @@ void WatchWindow::keyPressEvent(QKeyEvent *ev) if (ev->key() == Qt::Key_Delete && m_type == WatchersType) { QModelIndex idx = currentIndex(); QModelIndex idx1 = idx.sibling(idx.row(), 0); - QString exp = idx1.data().toString(); + QString exp = idx1.data(LocalsRawExpressionRole).toString(); removeWatchExpression(exp); } else if (ev->key() == Qt::Key_Return && ev->modifiers() == Qt::ControlModifier