From 02404afd9fa582814c9a261295de03dd831a78ba Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 4 Mar 2015 14:00:00 +0100 Subject: [PATCH] Debugger: Allow evaluation of children of evaluated expressions Task-number: QTCREATORBUG-5920 Change-Id: I00a42b93e3840f106ee9d4e94e1bc9f677e13e3f Reviewed-by: Christian Stenger --- src/plugins/debugger/watchwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 2ea8632e58e..33cc5be3aff 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -744,9 +744,12 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) actSelectWidgetToWatch.setEnabled(canHandleWatches && canInsertWatches && engine->hasCapability(WatchWidgetsCapability)); + bool canAddWatches = canHandleWatches && !exp.isEmpty(); + // Suppress for top-level watchers. + if (m_type == WatchersType && mi0.parent().isValid() && !mi0.parent().parent().isValid()) + canAddWatches = false; QAction actWatchExpression(addWatchActionText(exp), 0); - actWatchExpression.setEnabled( - canHandleWatches && !exp.isEmpty() && m_type == LocalsType); + actWatchExpression.setEnabled(canAddWatches); // Can remove watch if engine can handle it or session engine. QModelIndex p = mi0;