forked from qt-creator/qt-creator
debugger: fix deletion of multiple watchers
Task-number: QTCREATORBUG-3586 Change-Id: I6b80ae7147301cd61277bd64abaee3fe8f910f38 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -512,10 +512,16 @@ void WatchWindow::collapseNode(const QModelIndex &idx)
|
||||
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(LocalsRawExpressionRole).toString();
|
||||
removeWatchExpression(exp);
|
||||
QModelIndexList indices = selectionModel()->selectedRows();
|
||||
if (indices.isEmpty() && selectionModel()->currentIndex().isValid())
|
||||
indices.append(selectionModel()->currentIndex());
|
||||
QStringList exps;
|
||||
foreach (const QModelIndex &idx, indices) {
|
||||
QModelIndex idx1 = idx.sibling(idx.row(), 0);
|
||||
exps.append(idx1.data(LocalsRawExpressionRole).toString());
|
||||
}
|
||||
foreach (const QString &exp, exps)
|
||||
removeWatchExpression(exp);
|
||||
} else if (ev->key() == Qt::Key_Return
|
||||
&& ev->modifiers() == Qt::ControlModifier
|
||||
&& m_type == LocalsType) {
|
||||
|
||||
Reference in New Issue
Block a user