OSDN Git Service

debugger: fix removal of dummy <Edit> watch item using the <Del> key
authorhjk <qtc-committer@nokia.com>
Thu, 17 Mar 2011 18:37:07 +0000 (19:37 +0100)
committerhjk <qtc-committer@nokia.com>
Thu, 17 Mar 2011 18:37:07 +0000 (19:37 +0100)
src/plugins/debugger/debuggerconstants.h
src/plugins/debugger/watchhandler.cpp
src/plugins/debugger/watchwindow.cpp

index 3a9e6b4..c7ba883 100644 (file)
@@ -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
index 2fe3481..f7826cc 100644 (file)
@@ -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;
 
index eb93669..1632e65 100644 (file)
@@ -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