Commit b1d255ef authored by hjk's avatar hjk

debugger: fix removal of dummy <Edit> watch item using the <Del> key

parent d1f62507
......@@ -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
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment