Commit bc5cda03 authored by Aurindam Jana's avatar Aurindam Jana Committed by Kai Koehne

Inspector: Do not disable Locals and Expressions

Inspector follows a different cycle and its contents are
always valid during a debug session. Show the values in
Locals and Expressions as valid for user to interact
with them.

Task-number: QTCREATORBUG-8167

Change-Id: If2f622de5b8bf6da78571bc007efd19602a5f389
Reviewed-by: default avatarhjk <>
Reviewed-by: default avatarRobert Loehning <>
Reviewed-by: default avatarEike Ziller <>
Reviewed-by: default avatarKai Koehne <>
parent 28bcc563
......@@ -731,10 +731,10 @@ bool WatchModel::canFetchMore(const QModelIndex &idx) const
if (!idx.isValid())
return false;
if (!contentIsValid())
return false;
WatchItem *item = watchItem(idx);
QTC_ASSERT(item, return false);
if (!contentIsValid() && !item->isInspect())
return false;
if (!item->iname.contains('.'))
return false;
return !m_fetchTriggered.contains(item->iname);
......@@ -1032,7 +1032,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
static const QVariant red(QColor(200, 0, 0));
static const QVariant gray(QColor(140, 140, 140));
if (idx.column() == 1) {
if (!data.valueEnabled || !contentIsValid())
if (!data.valueEnabled || (!contentIsValid() && !data.isInspect()))
return gray;
if (data.value != m_valueCache.value(data.iname))
return red;
......@@ -1152,10 +1152,11 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role
Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const
if (!contentIsValid())
if (!idx.isValid())
return Qt::ItemFlags();
if (!idx.isValid())
const WatchData &data = *watchItem(idx);
if (!contentIsValid() && !data.isInspect())
return Qt::ItemFlags();
// Enabled, editable, selectable, checkable, and can be used both as the
......@@ -1166,7 +1167,6 @@ Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const
static const Qt::ItemFlags editable = notEditable | Qt::ItemIsEditable;
// Disable editing if debuggee is positively running except for Inspector data
const WatchData &data = *watchItem(idx);
const bool isRunning = engine() && engine()->state() == InferiorRunOk;
if (isRunning && engine() && !engine()->hasCapability(AddWatcherWhileRunningCapability) &&
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