Debugger: Rework editor tooltips handling

Fix expansion and updating.

Persistence and non-locals are still lacking.

Change-Id: I74e25199d50350516afc686a05836e239bfc8acb
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2014-07-10 18:10:56 +02:00
parent a97aa6be67
commit f0b2d6535e
14 changed files with 465 additions and 692 deletions

View File

@@ -1025,31 +1025,31 @@ void WatchTreeView::handleItemIsExpanded(const QModelIndex &idx)
expand(idx);
}
void WatchTreeView::resetHelper()
{
QModelIndex idx = model()->index(m_type, 0);
resetHelper(idx);
expand(idx);
}
void WatchTreeView::resetHelper(const QModelIndex &idx)
void WatchTreeView::reexpand(QTreeView *view, const QModelIndex &idx)
{
if (idx.data(LocalsExpandedRole).toBool()) {
//qDebug() << "EXPANDING " << model()->data(idx, LocalsINameRole);
if (!isExpanded(idx)) {
expand(idx);
for (int i = 0, n = model()->rowCount(idx); i != n; ++i) {
QModelIndex idx1 = model()->index(i, 0, idx);
resetHelper(idx1);
//qDebug() << "EXPANDING " << view->model()->data(idx, LocalsINameRole);
if (!view->isExpanded(idx)) {
view->expand(idx);
for (int i = 0, n = view->model()->rowCount(idx); i != n; ++i) {
QModelIndex idx1 = view->model()->index(i, 0, idx);
reexpand(view, idx1);
}
}
} else {
//qDebug() << "COLLAPSING " << model()->data(idx, LocalsINameRole);
if (isExpanded(idx))
collapse(idx);
//qDebug() << "COLLAPSING " << view->model()->data(idx, LocalsINameRole);
if (view->isExpanded(idx))
view->collapse(idx);
}
}
void WatchTreeView::resetHelper()
{
QModelIndex idx = model()->index(m_type, 0);
reexpand(this, idx);
expand(idx);
}
void WatchTreeView::reset()
{
BaseTreeView::reset();