Commit 90b15b02 authored by hjk's avatar hjk
Browse files

Debugger: Show some text even for disabled context menu action



Task-number: QTCREATORBUG-12527
Change-Id: I293481f7e54a94de375e2cfc50a32ccaeb28231b
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent 095111b2
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment