From 90b15b0245cfa5b7058ac563df184355ef0e68a3 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 27 Jun 2014 14:54:31 +0200 Subject: [PATCH] Debugger: Show some text even for disabled context menu action Task-number: QTCREATORBUG-12527 Change-Id: I293481f7e54a94de375e2cfc50a32ccaeb28231b Reviewed-by: Nikolai Kosjar --- src/plugins/debugger/watchwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index d6fe5511992..2f887680f87 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -754,6 +754,8 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) QAction actSetWatchpointAtObjectAddress(0); QAction actSetWatchpointAtPointerAddress(0); + actSetWatchpointAtPointerAddress.setText(tr("Add Data Breakpoint at Pointer's Address")); + actSetWatchpointAtPointerAddress.setEnabled(false); const bool canSetWatchpoint = engine->hasCapability(WatchpointByAddressCapability); if (canSetWatchpoint && address) { actSetWatchpointAtObjectAddress @@ -764,9 +766,9 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) actSetWatchpointAtPointerAddress .setText(tr("Add Data Breakpoint at Pointer's Address (0x%1)") .arg(pointerAddress, 0, 16)); - actSetWatchpointAtPointerAddress.setCheckable(true); actSetWatchpointAtPointerAddress .setChecked(mi0.data(LocalsIsWatchpointAtPointerAddressRole).toBool()); + actSetWatchpointAtPointerAddress.setEnabled(true); } } else { actSetWatchpointAtObjectAddress.setText(tr("Add Data Breakpoint")); @@ -873,8 +875,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) QMenu breakpointMenu; breakpointMenu.setTitle(tr("Add Data Breakpoint...")); breakpointMenu.addAction(&actSetWatchpointAtObjectAddress); - if (canSetWatchpoint && address) - breakpointMenu.addAction(&actSetWatchpointAtPointerAddress); + breakpointMenu.addAction(&actSetWatchpointAtPointerAddress); breakpointMenu.addAction(&actSetWatchpointAtExpression); QAction actCopy(tr("Copy View Contents to Clipboard"), 0);