summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-03-09 10:58:40 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-03-09 10:58:40 (GMT)
commit3b58b103bfa2e2b9bb12a042cbba36fb0a1baf9f (patch)
tree38f12fe9478c9637b032d26beef305aa7e606875 /src
parentf7fe4701713aff5f5af146fafbb38fa852ebde33 (diff)
downloadQt-3b58b103bfa2e2b9bb12a042cbba36fb0a1baf9f.zip
Qt-3b58b103bfa2e2b9bb12a042cbba36fb0a1baf9f.tar.gz
Qt-3b58b103bfa2e2b9bb12a042cbba36fb0a1baf9f.tar.bz2
QTreeView: let the dataChanged signal refresh the hasChildren attribute.
That is required for the Locals & Watchers view in Creator. Task-number: QTBUG-7115 Reviewed-by: Thierry
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qtreeview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 1145235..78184a9 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -679,16 +679,20 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto
d->defaultItemHeight = indexRowSizeHint(topLeft);
bool sizeChanged = false;
if (topViewIndex != -1) {
- if (topLeft == bottomRight) {
+ if (topLeft.row() == bottomRight.row()) {
int oldHeight = d->itemHeight(topViewIndex);
d->invalidateHeightCache(topViewIndex);
sizeChanged = (oldHeight != d->itemHeight(topViewIndex));
+ if (topLeft.column() == 0)
+ d->viewItems[topViewIndex].hasChildren = d->hasVisibleChildren(topLeft);
} else {
int bottomViewIndex = d->viewIndex(bottomRight);
for (int i = topViewIndex; i <= bottomViewIndex; ++i) {
int oldHeight = d->itemHeight(i);
d->invalidateHeightCache(i);
sizeChanged |= (oldHeight != d->itemHeight(i));
+ if (topLeft.column() == 0)
+ d->viewItems[i].hasChildren = d->hasVisibleChildren(d->viewItems.at(i).index);
}
}
}