Debugger: Allow watching complex expression for QML

Latest restructuring made the 'Add Expression Evaluator'
action to a no-op when not debugging.
Reflect this by disabling the action as long the user is
not debugging and allow complex expressions to be evaluated
for QML as well.

Fixes: QTCREATORBUG-19050
Change-Id: I2d6421a121e2169981b992a617f4d2b7264a8091
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2018-09-24 14:41:51 +02:00
parent c0378ee7e8
commit 1b751c2d47
2 changed files with 4 additions and 3 deletions

View File

@@ -1629,7 +1629,7 @@ void DebuggerPluginPrivate::updatePresetState()
m_attachToRunningApplication.setEnabled(true); m_attachToRunningApplication.setEnabled(true);
m_attachToUnstartedApplication.setEnabled(true); m_attachToUnstartedApplication.setEnabled(true);
m_watchAction.setEnabled(true); m_watchAction.setEnabled(state != DebuggerFinished && state != DebuggerNotReady);
m_breakAction.setEnabled(true); m_breakAction.setEnabled(true);
} }
@@ -2055,7 +2055,7 @@ void DebuggerPluginPrivate::setInitialState()
m_attachToUnstartedApplication.setEnabled(true); m_attachToUnstartedApplication.setEnabled(true);
m_detachAction.setEnabled(false); m_detachAction.setEnabled(false);
m_watchAction.setEnabled(true); m_watchAction.setEnabled(false);
m_breakAction.setEnabled(false); m_breakAction.setEnabled(false);
//m_snapshotAction.setEnabled(false); //m_snapshotAction.setEnabled(false);
action(OperateByInstruction)->setChecked(false); action(OperateByInstruction)->setChecked(false);

View File

@@ -962,7 +962,8 @@ bool QmlEngine::hasCapability(unsigned cap) const
{ {
return cap & (AddWatcherCapability return cap & (AddWatcherCapability
| AddWatcherWhileRunningCapability | AddWatcherWhileRunningCapability
| RunToLineCapability); | RunToLineCapability
| WatchComplexExpressionsCapability);
/*ReverseSteppingCapability | SnapshotCapability /*ReverseSteppingCapability | SnapshotCapability
| AutoDerefPointersCapability | DisassemblerCapability | AutoDerefPointersCapability | DisassemblerCapability
| RegisterCapability | ShowMemoryCapability | RegisterCapability | ShowMemoryCapability