diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2019-07-01 12:59:52 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2019-07-01 11:11:01 +0000 |
commit | 3cc286de3d732e11cf804793290ca75df7c598e2 (patch) | |
tree | 7779f06d63c4f6c58410e403795045831302b7a6 /src/plugins/debugger/debuggertooltipmanager.cpp | |
parent | db288667fecfe740a9cb37df83950738cdf449b6 (diff) | |
download | qt-creator-3cc286de3d732e11cf804793290ca75df7c598e2.tar.gz |
ToolTipWatchItem: Fix column mapping
Commit e95fd876 ("Debugger: Make the time stamp recording
option work for single items") introduced an enum, and the old
(off-by-one from column 1 on) plain integers were used here,
leading to the problem that the second column would always
show "0" and the actual value would go to the third column
instead of the second one when hovering over a variable
with the mouse in debug mode.
Use the enum values to make it work as expected.
Change-Id: I3a66596281e27a3bcc953ee6ea461755d5e64d5c
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/debugger/debuggertooltipmanager.cpp')
-rw-r--r-- | src/plugins/debugger/debuggertooltipmanager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 2ad12ff682..611e714abd 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -259,13 +259,13 @@ ToolTipWatchItem::ToolTipWatchItem(TreeItem *item) { const QAbstractItemModel *model = item->model(); QModelIndex idx = item->index(); - name = model->data(idx.sibling(idx.row(), 0), Qt::DisplayRole).toString(); - value = model->data(idx.sibling(idx.row(), 1), Qt::DisplayRole).toString(); - type = model->data(idx.sibling(idx.row(), 2), Qt::DisplayRole).toString(); - iname = model->data(idx.sibling(idx.row(), 0), LocalsINameRole).toString(); - valueColor = model->data(idx.sibling(idx.row(), 1), Qt::ForegroundRole).value<QColor>(); + name = model->data(idx.sibling(idx.row(), WatchModelBase::NameColumn), Qt::DisplayRole).toString(); + value = model->data(idx.sibling(idx.row(), WatchModelBase::ValueColumn), Qt::DisplayRole).toString(); + type = model->data(idx.sibling(idx.row(), WatchModelBase::TypeColumn), Qt::DisplayRole).toString(); + iname = model->data(idx.sibling(idx.row(), WatchModelBase::NameColumn), LocalsINameRole).toString(); + valueColor = model->data(idx.sibling(idx.row(), WatchModelBase::ValueColumn), Qt::ForegroundRole).value<QColor>(); expandable = model->hasChildren(idx); - expression = model->data(idx.sibling(idx.row(), 0), Qt::EditRole).toString(); + expression = model->data(idx.sibling(idx.row(), WatchModelBase::NameColumn), Qt::EditRole).toString(); for (TreeItem *child : *item) appendChild(new ToolTipWatchItem(child)); } |