From e2c296c46b3f922ed12f83b166b1493dfded480e Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 11 Apr 2016 12:44:00 +0200 Subject: QML: Pass the kind of geometry change around This prevents re-calculation of what actually changed, and removes the now unused parameter newGeometry. Other than this change calculation, the only place where oldGeometry was used is QQuickListViewPrivate::itemGeometryChanged. To get rid of oldGeometry too, QQuickListViewPrivate now stores the current (i.e. last known) geometry, and updates it in itemGeometryChanged. Change-Id: I8a5286d08a04132c9a4c81de7ce221f5676946e6 Reviewed-by: Frederik Gladhorn Reviewed-by: Robin Burchell --- src/quick/items/qquickflickable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/quick/items/qquickflickable.cpp') diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 1bcc3cc0f9..a09088dfed 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -292,14 +292,14 @@ void QQuickFlickablePrivate::AxisData::updateVelocity() } } -void QQuickFlickablePrivate::itemGeometryChanged(QQuickItem *item, const QRectF &newGeom, const QRectF &oldGeom) +void QQuickFlickablePrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) { Q_Q(QQuickFlickable); if (item == contentItem) { Qt::Orientations orient = 0; - if (newGeom.x() != oldGeom.x()) + if (change.xChange()) orient |= Qt::Horizontal; - if (newGeom.y() != oldGeom.y()) + if (change.yChange()) orient |= Qt::Vertical; if (orient) q->viewportMoved(orient); -- cgit v1.2.3