debugger: make views searchable

Change-Id: Icade50bfaa884d88e451e688acf62d6793346628
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-03-22 11:54:49 +01:00
committed by hjk
parent 22a949b5c1
commit 32ec60958d
12 changed files with 138 additions and 96 deletions

View File

@@ -71,22 +71,19 @@ void SnapshotWindow::rowActivated(const QModelIndex &index)
void SnapshotWindow::keyPressEvent(QKeyEvent *ev)
{
if (ev->key() == Qt::Key_Delete) {
QItemSelectionModel *sm = selectionModel();
QTC_ASSERT(sm, return);
QModelIndexList si = sm->selectedIndexes();
if (si.isEmpty())
si.append(currentIndex().sibling(currentIndex().row(), 0));
QModelIndexList si = selectedIndices();
foreach (const QModelIndex &idx, si)
if (idx.column() == 0)
removeSnapshot(idx.row());
}
QTreeView::keyPressEvent(ev);
BaseWindow::keyPressEvent(ev);
}
void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
{
QModelIndex idx = indexAt(ev->pos());
QModelIndexList si = selectedIndices(ev);
QTC_ASSERT(si.size() == 1, return);
QModelIndex idx = si.at(0);
QMenu menu;