diff options
author | Robin Burchell <robin.burchell@theqtcompany.com> | 2015-12-22 00:06:06 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2016-01-15 11:04:22 +0000 |
commit | 96f1bb07eb420d5e01f1ea0273c7c9223adaf504 (patch) | |
tree | 5e13b286c83a8b557c72fe9d56ab110f09d3bfbd /src/quick/items/qquickitemview.cpp | |
parent | f4fb1ff1883ae6c9bafad41343eae4dd7fd51e55 (diff) |
QQuickItemView: Take sticky header/footer into account for positionViewAtIndex().
When using an overlaid header or footer, we must adjust the position we come up
with by the appropriate size in order to end up at the correct place.
Change-Id: I218b9aef7fdf37f56ffb63dc395f97045b55a186
Task-number: QTBUG-50097
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickitemview.cpp')
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index b618daf64b..e301e8f0f2 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -928,7 +928,7 @@ void QQuickItemViewPrivate::positionViewAtIndex(int index, int mode) switch (mode) { case QQuickItemView::Beginning: pos = itemPos; - if (index < 0 && header) + if (header && (index < 0 || hasStickyHeader())) pos -= headerSize(); break; case QQuickItemView::Center: @@ -936,7 +936,7 @@ void QQuickItemViewPrivate::positionViewAtIndex(int index, int mode) break; case QQuickItemView::End: pos = itemPos - size() + item->size(); - if (index >= model->count() && footer) + if (footer && (index >= model->count() || hasStickyFooter())) pos += footerSize(); break; case QQuickItemView::Visible: |