aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicklistview.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2025-08-22 09:33:17 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2025-08-22 09:33:17 +0300
commitc6fdadd916a7568c1d71b750e054ca9aa2fd5dfc (patch)
treebbd5690b38a5e0df66dd070a9e9f42b0d1b2b673 /src/quick/items/qquicklistview.cpp
parenta7c766a9863605eb81e8f0cdb4d2b93e087b5bde (diff)
parente436dad999060b92965291b45c0e95a3b93f5866 (diff)
Merge tag 'v6.2.13-lts' into tqtc/lts-6.2-opensourcev6.2.13-lts-lgpl6.2
Qt 6.2.13-lts release Conflicts solved: dependencies.yaml Change-Id: I3cbe1ce4293179888e236dd1a3a299cd2c66c950
Diffstat (limited to 'src/quick/items/qquicklistview.cpp')
-rw-r--r--src/quick/items/qquicklistview.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 9e7a8f4803..6c822e62c1 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1721,7 +1721,7 @@ void QQuickListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte
updateHighlight();
bottomItem = currentItem;
}
- qreal pos;
+ qreal pos = 0;
bool isInBounds = -position() > maxExtent && -position() <= minExtent;
if (header && !topItem && isInBounds) {
@@ -1802,6 +1802,19 @@ void QQuickListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExte
QQuickItemViewPrivate::fixup(data, minExtent, maxExtent);
return;
}
+ // If we have the CurrentLabelAtStart flag set, then we need to consider
+ // the section size while calculating the position
+ if (sectionCriteria
+ && (sectionCriteria->labelPositioning() & QQuickViewSection::CurrentLabelAtStart)
+ && currentSectionItem) {
+ auto sectionSize = (orient == QQuickListView::Vertical) ? currentSectionItem->height()
+ : currentSectionItem->width();
+ if (isContentFlowReversed())
+ pos += sectionSize;
+ else
+ pos -= sectionSize;
+ }
+
pos = qBound(-minExtent, pos, -maxExtent);
qreal dist = qAbs(data.move + pos);
@@ -2380,7 +2393,7 @@ QQuickListView::~QQuickListView()
/*!
\qmlproperty int QtQuick::ListView::count
- This property holds the number of items in the view.
+ This property holds the number of items in the model.
*/
/*!