diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-11-09 12:55:06 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-11-09 14:30:46 +0000 |
commit | 80ef46b3b2c234832be4280ea7025083fd4f632a (patch) | |
tree | 297b24829a58bcc50669304fec04a4dad1ab9bd9 /src/quicktemplates2/qquickscrollbar.cpp | |
parent | 9fe41d4fa712ec9b1ccc49a59902067ce4a8d25b (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickscrollbar.cpp')
-rw-r--r-- | src/quicktemplates2/qquickscrollbar.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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); } } |