diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index b3c64958a72eff724640beb18059a63fa3af3667..9b7556d55470f5a0516fa39f4878249df989f03e 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -219,7 +219,7 @@ ToolTipWatchItem::ToolTipWatchItem(WatchItem *item) value = item->displayValue(); type = item->displayType(); iname = item->iname; - valueColor = item->valueColor(); + valueColor = item->valueColor(1); expandable = item->hasChildren(); expression = item->expression(); foreach (TreeItem *child, item->children()) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index cc27ae30c1ddb9a27bb37098a067fa7e73bf0fd9..a77b2d573873cd69ec620be166a05f9869de5b89 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -776,21 +776,24 @@ QString WatchItem::displayType() const return result; } -QColor WatchItem::valueColor() const -{ - using Utils::Theme; - Theme *theme = Utils::creatorTheme(); - if (watchModel()) { - if (!valueEnabled) - return theme->color(Theme::Debugger_WatchItem_ValueInvalid); - if (!watchModel()->m_contentsValid && !isInspect()) - return theme->color(Theme::Debugger_WatchItem_ValueInvalid); - if (value.isEmpty()) // This might still show 0x... - return theme->color(Theme::Debugger_WatchItem_ValueInvalid); - if (value != watchModel()->m_valueCache.value(iname)) - return theme->color(Theme::Debugger_WatchItem_ValueChanged); +QColor WatchItem::valueColor(int column) const +{ + Theme::Color color = Theme::Debugger_WatchItem_ValueNormal; + if (const WatchModel *model = watchModel()) { + if (!model->m_contentsValid && !isInspect()) { + color = Theme::Debugger_WatchItem_ValueInvalid; + } else if (column == 1) { + if (!valueEnabled) + color = Theme::Debugger_WatchItem_ValueInvalid; + else if (!model->m_contentsValid && !isInspect()) + color = Theme::Debugger_WatchItem_ValueInvalid; + else if (column == 1 && value.isEmpty()) // This might still show 0x... + color = Theme::Debugger_WatchItem_ValueInvalid; + else if (column == 1 && value != model->m_valueCache.value(iname)) + color = Theme::Debugger_WatchItem_ValueChanged; + } } - return theme->color(Theme::Debugger_WatchItem_ValueNormal); + return creatorTheme()->color(color); } QVariant WatchItem::data(int column, int role) const @@ -837,8 +840,7 @@ QVariant WatchItem::data(int column, int role) const ? toToolTip() : QVariant(); case Qt::ForegroundRole: - if (column == 1) - return valueColor(); + return valueColor(column); case LocalsExpressionRole: return expression(); diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 0d9f53abec3e2d9406ab6af2f527814f9b9e3799..b01a3110c4785e083bd60337ce3d2f0d55d7f440 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -107,7 +107,7 @@ public: QVariant editValue() const; int editType() const; - QColor valueColor() const; + QColor valueColor(int column) const; int requestedFormat() const; WatchItem *findItem(const QByteArray &iname);