summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/debugger/debuggertooltipmanager.cpp2
-rw-r--r--src/plugins/debugger/watchhandler.cpp34
-rw-r--r--src/plugins/debugger/watchhandler.h2
3 files changed, 20 insertions, 18 deletions
diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp
index b3c64958a7..9b7556d554 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 cc27ae30c1..a77b2d5738 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 0d9f53abec..b01a3110c4 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);