From 80ef46b3b2c234832be4280ea7025083fd4f632a Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 9 Nov 2016 12:55:06 +0100 Subject: Prepare for a change to itemGeometryChanged In an upcoming patch for qtdeclarative, the rectangle passed to itemGeometryChanged will be the old geometry instead of the difference between the old an the new geometry. Change-Id: If096d4986900fea6ada10b18088de12490c9171b Reviewed-by: Simon Hausmann --- src/quicktemplates2/qquickscrollbar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/quicktemplates2/qquickscrollbar.cpp') diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp index 8e6db063..c291e4b1 100644 --- a/src/quicktemplates2/qquickscrollbar.cpp +++ b/src/quicktemplates2/qquickscrollbar.cpp @@ -565,11 +565,19 @@ void QQuickScrollBarAttachedPrivate::itemGeometryChanged(QQuickItem *item, const Q_UNUSED(item); Q_UNUSED(change); if (horizontal && horizontal->height() > 0) { +#ifdef QT_QUICK_NEW_GEOMETRY_CHANGED_HANDLING // TODO: correct/rename diff to oldGeometry + bool move = qFuzzyIsNull(horizontal->y()) || qFuzzyCompare(horizontal->y(), diff.height() - horizontal->height()); +#else bool move = qFuzzyIsNull(horizontal->y()) || qFuzzyCompare(horizontal->y(), item->height() - diff.height() - horizontal->height()); +#endif layoutHorizontal(move); } if (vertical && vertical->width() > 0) { +#ifdef QT_QUICK_NEW_GEOMETRY_CHANGED_HANDLING // TODO: correct/rename diff to oldGeometry + bool move = qFuzzyIsNull(vertical->x()) || qFuzzyCompare(vertical->x(), diff.width() - vertical->width()); +#else bool move = qFuzzyIsNull(vertical->x()) || qFuzzyCompare(vertical->x(), item->width() - diff.width() - vertical->width()); +#endif layoutVertical(move); } } -- cgit v1.2.3