Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
bc325eb9
Commit
bc325eb9
authored
Jul 14, 2010
by
hjk
Browse files
debugger: disable some watch related actions when appropriate
parent
9a1d9770
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/watchwindow.cpp
View file @
bc325eb9
...
...
@@ -283,7 +283,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
const
bool
actionsEnabled
=
modelData
(
EngineActionsEnabledRole
).
toBool
();
const
unsigned
engineCapabilities
=
modelData
(
EngineCapabilitiesRole
).
toUInt
();
const
bool
canHandleWatches
=
actionsEnabled
&&
(
engineCapabilities
&
AddWatcherCapability
);
const
bool
canHandleWatches
=
actionsEnabled
&&
(
engineCapabilities
&
AddWatcherCapability
);
QMenu
menu
;
QAction
*
actInsertNewWatchItem
=
menu
.
addAction
(
tr
(
"Insert New Watch Item"
));
...
...
@@ -335,12 +336,15 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
actSetWatchPointAtVariableAddress
->
setEnabled
(
false
);
}
QAction
*
actWatchExpression
=
new
QAction
(
tr
(
"Watch Expression
\"
%1
\"
"
).
arg
(
exp
),
&
menu
);
actWatchExpression
->
setEnabled
(
canHandleWatches
);
QString
actionName
=
exp
.
isEmpty
()
?
tr
(
"Watch Expression"
)
:
tr
(
"Watch Expression
\"
%1
\"
"
).
arg
(
exp
);
QAction
*
actWatchExpression
=
new
QAction
(
actionName
,
&
menu
);
actWatchExpression
->
setEnabled
(
canHandleWatches
&&
!
exp
.
isEmpty
());
QAction
*
actRemoveWatchExpression
=
new
QAction
(
tr
(
"Remove Watch Expression
\"
%1
\"
"
).
arg
(
exp
),
&
menu
);
actionName
=
exp
.
isEmpty
()
?
tr
(
"Remove Watch Expression"
)
:
tr
(
"Remove Watch Expression
\"
%1
\"
"
).
arg
(
exp
);
QAction
*
actRemoveWatchExpression
=
new
QAction
(
actionName
,
&
menu
);
actRemoveWatchExpression
->
setEnabled
(
canHandleWatches
&&
!
exp
.
isEmpty
());
if
(
m_type
==
LocalsType
)
menu
.
addAction
(
actWatchExpression
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment