summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qtreeview.cpp21
-rw-r--r--src/widgets/itemviews/qtreeview.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 61721143ef..d504263bd1 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -3992,6 +3992,27 @@ int QTreeView::visualIndex(const QModelIndex &index) const
return d->viewIndex(index);
}
+/*!
+ \reimp
+*/
+
+void QTreeView::verticalScrollbarValueChanged(int value)
+{
+ Q_D(QTreeView);
+ if (!d->viewItems.isEmpty() && value == verticalScrollBar()->maximum()) {
+ QModelIndex ret = d->viewItems.last().index;
+ // Root index will be handled by base class implementation
+ while (ret.isValid()) {
+ if (isExpanded(ret) && d->model->canFetchMore(ret)) {
+ d->model->fetchMore(ret);
+ break;
+ }
+ ret = ret.parent();
+ }
+ }
+ QAbstractItemView::verticalScrollbarValueChanged(value);
+}
+
QT_END_NAMESPACE
#include "moc_qtreeview.cpp"
diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h
index c32c127cd1..e9bc8189f8 100644
--- a/src/widgets/itemviews/qtreeview.h
+++ b/src/widgets/itemviews/qtreeview.h
@@ -169,6 +169,7 @@ protected Q_SLOTS:
void columnMoved();
void reexpand();
void rowsRemoved(const QModelIndex &parent, int first, int last);
+ void verticalScrollbarValueChanged(int value) Q_DECL_OVERRIDE;
protected:
QTreeView(QTreeViewPrivate &dd, QWidget *parent = Q_NULLPTR);