debugger: simplify code for inserting new watchitems

This commit is contained in:
hjk
2010-07-23 18:20:13 +02:00
parent e0c8bc6fff
commit 3f36dbd81a
7 changed files with 12 additions and 35 deletions

View File

@@ -206,9 +206,8 @@ void WatchWindow::mouseDoubleClickEvent(QMouseEvent *ev)
{
const QModelIndex idx = indexAt(ev->pos());
if (!idx.isValid()) {
// The "<Edit>" string.
QVariant placeHolder = model()->data(idx, WatcherEditPlaceHolderRole);
setModelData(RequestWatchExpressionRole, placeHolder);
// The "<Edit>" case.
watchExpression(QString());
return;
}
QTreeView::mouseDoubleClickEvent(ev);
@@ -410,7 +409,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
} else if (act == actAlwaysAdjustColumnWidth) {
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
} else if (act == actInsertNewWatchItem) {
watchExpression(WatchHandler::watcherEditPlaceHolder());
watchExpression(QString());
} else if (act == actOpenMemoryEditAtVariableAddress) {
setModelData(RequestShowMemoryRole, address);
} else if (act == actOpenMemoryEditAtPointerValue) {