summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxlistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx/qfxlistview.cpp')
-rw-r--r--src/declarative/fx/qfxlistview.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 15680e1..f9ae0c0 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -343,6 +343,15 @@ public:
return true;
}
+ void updateViewport() {
+ Q_Q(QFxListView);
+ if (orient == QFxListView::Vertical)
+ q->setViewportHeight(endPosition() - startPosition());
+ else
+ q->setViewportWidth(endPosition() - startPosition());
+ }
+
+
// for debugging only
void checkVisible() const {
int skip = 0;
@@ -553,10 +562,7 @@ void QFxListViewPrivate::refill(qreal from, qreal to)
updateAverage();
if (!sectionExpression.isEmpty())
updateCurrentSection();
- if (orient == QFxListView::Vertical)
- q->setViewportHeight(endPosition() - startPosition());
- else
- q->setViewportWidth(endPosition() - startPosition());
+ updateViewport();
}
}
@@ -581,6 +587,7 @@ void QFxListViewPrivate::layout()
updateHighlight();
fixupPosition();
updateUnrequestedPositions();
+ updateViewport();
}
void QFxListViewPrivate::updateUnrequestedIndexes()
@@ -1804,6 +1811,7 @@ void QFxListView::itemsInserted(int modelIndex, int count)
for (int j = 0; j < added.count(); ++j)
added.at(j)->attached->emitAdd();
d->updateUnrequestedPositions();
+ d->updateViewport();
emit countChanged();
}