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>
This commit is contained in:
Michael Weghorn
2019-07-01 12:59:52 +02:00
parent db288667fe
commit 3cc286de3d

View File

@@ -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));
}