aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorTony Leinonen <tony.leinonen@qt.io>2021-05-04 17:12:49 +0300
committerTony Leinonen <tony.leinonen@qt.io>2022-01-03 07:25:17 +0000
commitb2a4a61e8cb0839ba293783ac03c72f35c7b1307 (patch)
tree97a4d0e41679bc13277e4fbcbfd7247425482d0e /src/quick/items
parent85a74c3195cca9c5003cdfd325f3fe4a8579f3d7 (diff)
GridView: Set content position when changing cell size
Content size was calculated before the new data was applied. This caused problems when calculating the column count while resizing the window. Fixes: QTBUG-92998 Change-Id: Ia4401c0e34cd11dc9e6c24a0320dbf0ca2f59ab9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6254b383309a0c3cd273264466105a7e3599a1ed) Reviewed-by: Tony Leinonen <tony.leinonen@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickgridview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
index f87b44a2d5..99cfec73dd 100644
--- a/src/quick/items/qquickgridview.cpp
+++ b/src/quick/items/qquickgridview.cpp
@@ -1653,6 +1653,7 @@ void QQuickGridView::setCellWidth(qreal cellWidth)
d->updateViewport();
emit cellWidthChanged();
d->forceLayoutPolish();
+ QQuickFlickable::setContentX(d->contentXForPosition(d->position()));
}
}
@@ -1670,6 +1671,7 @@ void QQuickGridView::setCellHeight(qreal cellHeight)
d->updateViewport();
emit cellHeightChanged();
d->forceLayoutPolish();
+ QQuickFlickable::setContentY(d->contentYForPosition(d->position()));
}
}
/*!